deedy5 / duckduckgo_search

Search for words, documents, images, videos, news, maps and text translation using the DuckDuckGo.com search engine. Downloading files and images to a local hard drive.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Solve Ratelimit

QIN2DIM opened this issue · comments

Add (Faker) Headers

async def main(keywords: str):
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0"
    }

    results = DDGS(headers=headers).text(keywords, max_results=5)
    print(results)

    return text

As a rule, you do not need to specify headers.
Requests already contain headers that mimic the browser.