Playwright¶
flowtask.interfaces.playwright
¶
PlaywrightService
¶
Bases: ABC
PlaywrightService
An interface for making HTTP connections using Playwright, analogous to your SeleniumService.
check_by_attribute
¶
Convert a tuple (attribute, value) into a Playwright selector. For example, ('id', 'submit') becomes '#submit' and ('xpath', '//button') becomes 'xpath=//button'.
get_driver
async
¶
Initialize Playwright, launch a browser (with proxy and/or mobile emulation if configured), and return a new Page instance.
get_etree
async
¶
Return a tuple of lxml etree objects (using etree.fromstring and html.fromstring) for the current page content.
get_page
async
¶
Navigate to a given URL, optionally set cookies, wait for page load, and optionally handle any cookie-acceptance banners.
get_soup
async
¶
Return a BeautifulSoup object for the current page content.
proxy_playwright
¶
Return a proxy configuration dictionary for Playwright.
save_screenshot
async
¶
Save a screenshot of the entire page or of a specific element if configured.
search_google_cse
async
¶
Perform a Google Custom Search Engine (CSE) search using Playwright. Returns a list of results where each result is a dict with 'title' and 'link'.