0

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

#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中我找到了这个答案:如何使用Python将Confluence页面与内容从一个空间移动到另一个空间?

我不想接受它在 Python 中“不起作用”。有没有人解决了这个问题?

4

0 回答 0