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

URL #158

Closed SXxinxiaosong closed 6 months ago

SXxinxiaosong commented 6 months ago

Before you open an issue:

  1. Make sure you have the latest version installed. Check: ddgs version. Update: pip install -U duckduckgo_search
  2. Try reinstalling the library: pip install -I duckduckgo_search
  3. Make sure the site https://duckduckgo.com is accessible in your browser
  4. Try using a proxy. The site may block ip for a while.

Describe the bug

Traceback (most recent call last):
  File "E:call_search_engine.py", line 235, in <module>
    evidences = call_search_engine(query, engine=engine)
  File "E:\call_search_engine.py", line 37, in call_search_engine
    for result in results:
  File "D:\Anaconda\envs\langchain\lib\site-packages\duckduckgo_search\duckduckgo_search.py", line 106, in text
    for i, result in enumerate(results, start=1):
  File "D:\Anaconda\envs\langchain\lib\site-packages\duckduckgo_search\duckduckgo_search.py", line 134, in _text_api
    vqd = self._get_vqd(keywords)
  File "D:\Anaconda\envs\langchain\lib\site-packages\duckduckgo_search\duckduckgo_search.py", line 64, in _get_vqd
    resp = self._get_url("POST", "https://duckduckgo.com", data={"q": keywords})

hello, this issue shows that the URL cannot be accessed, but my browser is able to access this URL. Hope to receive your help,THANKS!

deedy5 commented 6 months ago

update to v4.0.0 pip install -U duckduckgo_search