Skip to content

Googlesearch

flowtask.components.GoogleSearch

GoogleSearch

GoogleSearch(loop=None, job=None, stat=None, **kwargs)

Bases: GoogleBase

Google Custom Search Component

Overview:

This component performs Google Custom Search queries using the Google Custom Search API. It can search for specific queries and return results including URLs, titles, and snippets. The component can receive search terms either from a previous component or a list of terms specified in the configuration.

.. table:: Properties :widths: auto

+-----------------------+----------+------------------------------------------------------------------------------------------------------+ | Name | Required | Description | +-----------------------+----------+------------------------------------------------------------------------------------------------------+ | terms (list) | No | List of search terms to use. Required if no previous component provided | +-----------------------+----------+------------------------------------------------------------------------------------------------------+ | column (str) | No | Name of the column in the DataFrame when using a previous component | +-----------------------+----------+------------------------------------------------------------------------------------------------------+ | site (str) | No | Optional site restriction for the search (e.g., 'site:example.com') | +-----------------------+----------+------------------------------------------------------------------------------------------------------+ | max_results (int) | No | Maximum number of results to return per search (default: 1) | +-----------------------+----------+------------------------------------------------------------------------------------------------------+

Return:

The component returns a DataFrame with columns: 'search_term', 'search_url', 'search_title', 'search_snippet' containing the search results.

close async

close()

Clean up resources.

get_ddg_service async

get_ddg_service()

Get the DuckDuckGo search service.

get_search_service

get_search_service()

Get the Google Custom Search service.

run async

run()

Execute searches for each query in the DataFrame.

search async

search(idx, row)

Perform search using selected engine and return results.

start async

start(**kwargs)

Initialize the component and validate required parameters.