Currently I'm getting this error when I tried to update the confluence page.
error: HTTP RESONPONSE 500
this is my code:
################
import re
import bs4
import requests
headers={'Content-Type': 'application/json','Authorization': 'Basic token'}
dataurl='https://page/wiki/rest/api/content/1212121212?expand=body.storage'
contentx = requests.get(address, headers=headers).json()
content=contentx['body']['storage']['value']
regex = re.compile(r"<td>i need to update this</td>")
new_content = regex.sub("<td>updated</td>", content)
soupx = bs4.BeautifulSoup(new_content, features="html.parser")
soup=str(soupx)
payload={'id':'121212121212,'type':'page','title':'testing12121212','space':{'key':'space'},"body":{"storage":{"value":soup,"representation":"storage"}},'version':{'number':2}}
##########
i couldn't find what is the issue.
can someone help on this
Hello,
First of all I can't see where you do the update. Is this the whole script?
Second, check if the get works without a problem. Return contentx and see what it says. You should see which line you get the error.
Regards,
Elifcan
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.