微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用 Python API 在 Confluence 中复制包含图像的页面

如何解决使用 Python API 在 Confluence 中复制包含图像的页面

我正在尝试将页面复制到一个空间到另一个空间,包括附件。我使用此代码复制整个页面

#I want to easily copy a page from one space to another space
page_id = confluence.get_page_id("MARLENETES","NewMarlene(1)")
print(page_id)

# retrieve the page,including its content.
page_c = confluence.get_page_by_id(page_id,expand='body.storage')
#print(page_c)

# the body HTML
body = page_c['body']['storage']['value']
print(body)

parent_id = confluence.get_page_id("NB","halli2")

for i in range(1,2):
print('new test'.format(i))

# use the same above to retrieve the parent page's id.
confluence.create_page('MARLENETES','NewMarlene({})'.format(i),body,parent_id,type='page',representation='storage',editor='v2')
time.sleep(1)

但问题是页面中包含的任何图像都不会被复制。在stackoverflow中,我找到了这个答案:How to move Confluence pages along with the contents from one space to another using Python?

我不想接受它“对 Python 不起作用”。有人解决了吗?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。