So I am trying to load the html data of a page via playwright. Using it for the first time)
Referred the docs and created a simple function in python. But it takes a lot of time even a few minutes.
I would really appreciate it if you suggest some methods to increase the speed( Some related documentation will be helpful)
def playwright_html(url):
with sync_playwright() as playwright:
browser = playwright.chromium.launch()
context = browser.new_context()
page = context.new_page()
page.goto(url)
html_content = page.content()
#pprint(html_content)
browser.close()
if html_content:
return html_content
else:
return None
This thread is trying to answer question "How can I increase the speed of my playwright script that is taking a lot of time to load the html data of a page?"
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].