fix: Export PDF wait for render done

pull/15899/head
wangruidong 2025-08-21 18:42:00 +08:00 committed by 老广
parent 9551cd4da9
commit 30d781dd12
1 changed files with 3 additions and 0 deletions

View File

@ -96,6 +96,9 @@ def export_chart_to_pdf(chart_name, sessionid, request=None):
try:
page.goto(url, wait_until='networkidle')
page.wait_for_selector('.charts-zone', timeout=10000)
# 等待渲染完成
page.wait_for_timeout(2000)
page_title = page.title()
print(f"Page title: {page_title}")
pdf_bytes = page.pdf(format="A4", landscape=True,