Answer the question
In order to leave comments, you need to log in
How to change page in confluence using Python?
Good afternoon!
I can't figure out how to change the page in the confluence api.
I can get the page code itself using the get method:
def get_page_info(Link, login, password):
#Берем "Суп" страницы:
r = requests.get(str(Link), auth=HTTPBasicAuth(str(login), str(password)),verify=False)
return r
def write_data():
headers = {
'Content-Type': 'application',
}
info = get_page_info('https://confluence........ru/pages/viewpage.action?pageId=635355', "111111","9999999")
date = {"version": {"number": 2},
"title": "КБ_9999 - Global Site",
"type": "page",
"body": {"storage": {"value": "<p>TESTTT.</p>",
"representation": "storage"}}}
response = requests.put('https://confluence.........ru/pages/viewpage.action?pageId=613355',headers=headers ,data=json.dumps(date), auth=HTTPBasicAuth(".....", '.....'),verify=False)
result = get_page_info('https://confluence........ru/pages/viewpage.action?pageId=613655', "99999,"99999")
print('1',result)
write_data()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question