Skip to content

Reading large confluence page #1416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hemaswapnika1 opened this issue Jun 12, 2024 · 3 comments
Open

Reading large confluence page #1416

hemaswapnika1 opened this issue Jun 12, 2024 · 3 comments

Comments

@hemaswapnika1
Copy link

confluence.get_page_by_id(page_id, expand='body.storage') is not reading all the data if the confluence page is very large. (1500 KB)
How to handle reading of such large confluence pages?

@gonchik
Copy link
Member

gonchik commented Sep 15, 2024

Hi @hemaswapnika1
Just extend timeout during initializing that's enough

@eoinmarron
Copy link

I've bumped timeout up from the 75 (seconds presumably...) default in version 3.41.16 to 150 and I'm not getting any more of the page returned in my case.

I've also noticed the same behaviour with the Confluence API itself leading me to think this isn't necessarily a problem with the atlassian-python-api.

@eoinmarron
Copy link

eoinmarron commented Oct 14, 2024

On further exploration with the .get_page_as_pdf(page-id) method, I was able to observe the whole page contents writing to PDF.
I then tried to write the .get_page_by_id(page_id) output to file and it worked (whole page contents in file).
This then points to PyCharm as the problem rendering the full page when in debugger mode.

system:
Python 3.10.4
Pycharm 2024.2.1
atlassian-python-api 3.41.16

working code for me:

from atlassian import Confluence
conf = Confluence(
    url="https://confluence.foobar.com/",
    username="svc-crops-okta-confluence",
    token="foobar",
)
page_id = conf.get_page_id(
    "foobar",
    "foobar_page"
)
page_content = conf.get_page_by_id(page_id, expand="body.view")
html_body = page_content["body"]["view"]["value"]
with open("test_file.txt", "w") as stream:
    stream.write(html_body)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants