Playwright+BrowserSteps - Fetch changes - Fetch simply after page starts rendering + delay seconds, disable service workers

This commit is contained in:
dgtlmoon
2022-12-14 12:16:04 +01:00
committed by GitHub
parent 6562d6e0d4
commit 93cc30437f
2 changed files with 5 additions and 6 deletions

View File

@@ -286,6 +286,8 @@ class base_html_playwright(Fetcher):
proxy=self.proxy,
# This is needed to enable JavaScript execution on GitHub and others
bypass_csp=True,
# Can't think why we need the service workers for our use case?
service_workers='block',
# Should never be needed
accept_downloads=False
)
@@ -306,8 +308,7 @@ class base_html_playwright(Fetcher):
# Waits for the next navigation. Using Python context manager
# prevents a race condition between clicking and waiting for a navigation.
with self.page.expect_navigation():
response = self.page.goto(url, wait_until='load')
response = self.page.goto(url, wait_until='commit')
# Wait_until = commit
# - `'commit'` - consider operation to be finished when network response is received and the document started loading.
# Better to not use any smarts from Playwright and just wait an arbitrary number of seconds