7373import logging
7474import os
7575import time
76- from typing import Any , Dict , Optional
76+ from typing import Dict , Optional
7777from urllib .parse import quote
78+
7879import requests
7980from rich .panel import Panel
8081from rich .text import Text
81- from strands_tools .utils import console_util
8282from strands import tool
8383
84+ from strands_tools .utils import console_util
85+
8486logger = logging .getLogger (__name__ )
8587
8688console = console_util .create ()
@@ -141,7 +143,7 @@ def scrape_as_markdown(self, url: str, zone: Optional[str] = None) -> str:
141143
142144 Args:
143145 url (str): URL to scrape
144- zone: Override default Web Unlocker zone name (optional).
146+ zone: Override default Web Unlocker zone name (optional).
145147 Must be a Web Unlocker zone - datacenter/residential zones will fail.
146148 Default: "web_unlocker"
147149
@@ -201,7 +203,7 @@ def search_engine(
201203 Args:
202204 query (str): Search query
203205 engine (str): Search engine - 'google', 'bing', or 'yandex'
204- zone: Override default Web Unlocker zone name (optional).
206+ zone: Override default Web Unlocker zone name (optional).
205207 Must be a Web Unlocker zone - datacenter/residential zones will fail.
206208 Default: "web_unlocker"
207209
@@ -275,7 +277,6 @@ def search_engine(
275277 if return_json :
276278 params .append ("brd_json=1" )
277279
278-
279280 if params :
280281 search_url += "&" + "&" .join (params )
281282
@@ -421,8 +422,8 @@ def bright_data(
421422 action: The action to perform (scrape_as_markdown, get_screenshot, search_engine, web_data_feed)
422423 url: URL to scrape or extract data from (for scrape_as_markdown, get_screenshot, web_data_feed)
423424 output_path: Path to save the screenshot (for get_screenshot)
424- zone: Web Unlocker zone name (optional). If not provided, uses BRIGHTDATA_ZONE environment
425- variable, or defaults to "web_unlocker1". Set BRIGHTDATA_ZONE in your .env file to
425+ zone: Web Unlocker zone name (optional). If not provided, uses BRIGHTDATA_ZONE environment
426+ variable, or defaults to "web_unlocker1". Set BRIGHTDATA_ZONE in your .env file to
426427 configure your specific Web Unlocker zone name (e.g., BRIGHTDATA_ZONE=web_unlocker_12345)
427428 query: Search query (for search_engine)
428429 engine: Search engine to use (google, bing, yandex, default: google)
@@ -504,4 +505,4 @@ def bright_data(
504505 border_style = "red" ,
505506 )
506507 console .print (error_panel )
507- raise
508+ raise
0 commit comments