Selenium Service¶
flowtask.interfaces.selenium_service
¶
SeleniumService
¶
Bases: ABC
SeleniumService.
Interface for making HTTP connections using Selenium.
get_driver
async
¶
Return a Selenium Driver instance for Firefox, Edge, Safari, WebKitGTK or Chrome.
This method configures the browser based on instance flags (such as: - self.use_firefox, self.use_edge, self.use_safari, self.use_webkit - self.use_proxy, self._free_proxy, self.use_undetected - self.as_mobile for mobile emulation (Chrome-only) - self.enable_http2 (if False, HTTP/2 will be disabled)
It applies a common set of options (stored in self.chrome_options) to all browsers and adds proxy settings (if configured) to the options and/or desired capabilities.
Returns:
| Type | Description |
|---|---|
|
A Selenium WebDriver instance. |
get_page
async
¶
get_page with selenium.
Get one page using Selenium.
search_google_cse
async
¶
Search Google Custom Search Engine (CSE) using Selenium.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
The search query. |
required |
max_results
|
int
|
Maximum number of search results to return. |
5
|
Returns:
| Type | Description |
|---|---|
|
list[dict]: A list of search results with 'title' and 'link'. |