Log in and access Confluence with python

ConfulenceProvided REST API, easy to access through the command line
https://developer.atlassian.com/server/confluence/confluence-server-rest-api/

In addition, we can also directly access through python

import requests

cf_home_url = "http://192.168.0.205:8090/"
cf_page_url = cf_home_url + "pages/viewpage.action?pageId=1146899"

login_data = {
    
    
    "os_username": "林新发",
    "os_password": "123456",
    "login":"登录",
    "os_destination":"",
}

#登录
loginreqsession = requests.session()
logincontent = loginreqsession.post(cf_home_url, login_data).content.decode("utf-8")


#访问某个页面
page_html_text = loginreqsession.get(cf_page_url).content.decode("utf-8")
print(page_html_text)

Guess you like

Origin blog.csdn.net/linxinfa/article/details/108341920