elm.web.utilities.pw_page
- pw_page(browser, intercept_routes=False, stealth_config=None, ignore_https_errors=False, timeout=30000, use_scrapling_stealth=False)[source]
Create new page from playwright browser context
- Parameters:
browser (
playwright.Browser
) – A playwright browser instance.intercept_routes (bool, default=False) – Option to intercept all requests and abort blocked ones. Be default,
False
.stealth_config (
playwright_stealth.Stealth
, optional) – Optional tf-playwright-stealth StealthConfig configuration object instance. By default,None
, which uses all the default stealth options.ignore_https_errors (bool, default=False) – Option to ignore https errors (i.e. SSL cert errors). This is not generally safe to do - you are susceptible to MITM attacks. However, if you are doing a simple scrape without providing any sensitive information (which you probably shouldn’t be doing programmatically anyways), then it’s probably ok to ignore these errors. By default,
False
.timeout (int, default=30,000) – Default navigation and page load timeout (in milliseconds) to assign to page instance. By default,
30_000
.use_scrapling_stealth (bool, default=False) – Option to use scrapling stealth scripts instead of tf-playwright-stealth. If set to
True
, the stealth_config argument will be ignored. By default,False
.
- Yields:
playwright.Page
– A new page that can be used for visiting websites.