Skip to content

Commit

Permalink
Update research_web.py
Browse files Browse the repository at this point in the history
  • Loading branch information
VinciGit00 committed Jan 12, 2025
1 parent e18d524 commit 287ced2
Showing 1 changed file with 9 additions and 30 deletions.
39 changes: 9 additions & 30 deletions scrapegraphai/utils/research_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,36 +53,15 @@ def search_on_web(
try:
results = []
if search_engine == "google":

if region and language:
results = list(
google_search(
query,
num_results=max_results,
proxy=formatted_proxy,
lang=language,
region=region,
)
)
elif region:
results = list(
google_search(
query,
num_results=max_results,
proxy=formatted_proxy,
region=region,
lang=language,
)
)
else:
results = list(
google_search(
query,
num_results=max_results,
proxy=formatted_proxy,
lang=language,
)
)
kwargs = {
"num_results": max_results,
"proxy": formatted_proxy,
"lang": language,
}
if region:
kwargs["region"] = region

results = list(google_search(query, **kwargs))

elif search_engine == "duckduckgo":
research = DuckDuckGoSearchResults(max_results=max_results)
Expand Down

0 comments on commit 287ced2

Please sign in to comment.