Skip to content

fix: remove erroneous $ in BrightData SERP search URL f-strings#5271

Open
MilesQLi wants to merge 1 commit intocrewAIInc:mainfrom
MilesQLi:fix/brightdata-serp-js-template-syntax
Open

fix: remove erroneous $ in BrightData SERP search URL f-strings#5271
MilesQLi wants to merge 1 commit intocrewAIInc:mainfrom
MilesQLi:fix/brightdata-serp-js-template-syntax

Conversation

@MilesQLi
Copy link
Copy Markdown

@MilesQLi MilesQLi commented Apr 4, 2026

Summary

Fixes #5269

The get_search_url() method in BrightDataSearchTool was using JavaScript template literal syntax (${query}) instead of Python f-string syntax ({query}). This caused every search URL to contain a literal $ before the query string, e.g. ?q=$test instead of ?q=test.

All three search engine paths (Google, Bing, Yandex) had the same issue.

Changes

  • Removed the $ prefix from all three f-string interpolations in get_search_url() (lines 134, 136, 137 of brightdata_serp.py)

That's it — three characters removed. No behavioral changes beyond fixing the URLs.

Test plan

  • Verified no other ${...} patterns exist in the BrightData tool files
  • Confirmed the fix produces correct URLs by inspection:
    >>> query = "AI+news"
    >>> f"https://www.google.com/search?q={query}"
    'https://www.google.com/search?q=AI+news'
  • Existing CI should pass (no test changes)

The get_search_url method used JavaScript template literal syntax
(${query}) instead of Python f-string syntax ({query}), causing
every search query to be prepended with a literal '$' character.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] BrightData SERP tool uses JavaScript template syntax in Python f-strings, breaking all search queries

1 participant