我有一个有主体的端点。我想从 confluence (wiki) 获取端点的值,然后使用 confluence 脚本调用该端点。任何人都可以向我提供如何实现这一目标的详细步骤吗?
我没有得到步骤..任何人都可以帮助我,我该如何继续这里
为了使事情变得更容易,您可以尝试使用函数 confluence.get_page_by_id https://atlassian-python-api.readthedocs.io/confluence.html
下面是我亲自测试过的例子:
from atlassian import Confluence
confluence = Confluence(
url='https://site_name.atlassian.net',
username='email',
password='token_api',
cloud=True)
f = open('log.txt','w')
pg = confluence.get_page_by_id(2097171, expand='body.storage')
pg_content = pg['body']
print(pg_content, file=f) # Python 3.x
print('-----------------------------------------------------------------------------------------------', file=f)
pg = confluence.get_page_by_id(2097171, expand='body.view')
pg_content = pg['body']
print(pg_content, file=f) # Python 3.x