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.
MIT License
932 stars 117 forks source link

Problem with advertisements in search results #139

Closed lw4z closed 7 months ago

lw4z commented 7 months ago

Describe the bug In all searches, an advertisement link is appearing initially in the results. I noticed this outcome only in the latest version 3.9.8.

code:

from duckduckgo_search import DDGS
from itertools import islice

web_results = []

with DDGS(timeout=10) as ddgs:
    result_web_search = ddgs.text(
        keywords='dog',
        region='br-pt',
        safesearch='off',
        timelimit='',
        backend='html',
    )

    for r in islice(result_web_search, 3):
        web_results.append(r)
list({i['href']: i for i in web_results}.values())

Screenshots image

image

Specify this information

lw4z commented 7 months ago

Same code with 3.9.5 version: image

deedy5 commented 7 months ago

Thanks for the research. Fixed in v3.9.9