I m New at artwright and I m a Little uck. I m 拆解一个有大量回击和 Java字的场所。 我想,我 par的逻辑是等到页标题充满特殊价值时,这就会表明,该页的负荷足够平。
这里是我守则的相关部分。
with sync_playwright() as pw_firefox:
browser = pw_firefox.firefox.launch(headless=True, timeout=self.timeout)
context = browser.new_context(viewport={"width": 1920, "height": 1080},
extra_http_headers=HEADERS,
strict_selectors=False)
page = context.new_page()
# Go to url and wait for the page to load
page.goto(final_url)
html = page.content()
Is there a way to use the wait_for_selector()
or wait_for_function()
methods to get playwright to wait until the <title>
is populated with a specific value?
Thanks!