Closed Anonymous-Knight closed 6 months ago
I've tried using a proxy and the site https://duckduckgo.com/ is accessible in my browser.
Hi. I think there's a problem with the proxy syntax. Show me the code.
Hi. Here is the code i use proxy: Here is the printed proxies: Thanks for help.
What's proxy type showing?
print(proxies)
print(type(proxies))
It is a dict
The problem in proxy syntax. Since v4.0.0 duckduckgo_search
uses curl-cffi
.
httpx
:
proxies = {
"http://": "http://localhost:8030",
"https://": "http://localhost:8031",
}
curl-cffi
:
proxies = {
"http": "http://localhost:8030",
"https": "http://localhost:8031",
}
Thanks for your time! Help a lot.
Before you open an issue:
ddgs version
. Update:pip install -U duckduckgo_search
pip install -I duckduckgo_search
Describe the bug duckduckgo_search.exceptions.DuckDuckGoSearchException: _get_url() https://duckduckgo.com KeyError: 'https'
Debug log Traceback (most recent call last): File "/home/zhouzhenyu05/test/kwaipilot-tool-server/src/kuaishou/search/search.py", line 111, in
results = web_search('什么是okr')
File "/home/zhouzhenyu05/test/kwaipilot-tool-server/src/kuaishou/search/search.py", line 94, in web_search
google_result = google_search(query)
File "/home/zhouzhenyu05/test/kwaipilot-tool-server/src/kuaishou/search/search.py", line 52, in google_search
results = [SearchResult(title=item['title'],url=item['href'],content=item['body']) for item in search_results]
File "/home/zhouzhenyu05/test/kwaipilot-tool-server/src/kuaishou/search/search.py", line 52, in
results = [SearchResult(title=item['title'],url=item['href'],content=item['body']) for item in search_results]
File "/opt/conda/lib/python3.9/site-packages/duckduckgo_search/duckduckgo_search.py", line 91, in text
for i, result in enumerate(results, start=1):
File "/opt/conda/lib/python3.9/site-packages/duckduckgo_search/duckduckgo_search.py", line 119, in _text_api
vqd = self._get_vqd(keywords)
File "/opt/conda/lib/python3.9/site-packages/duckduckgo_search/duckduckgo_search.py", line 54, in _get_vqd
resp = self._get_url("POST", "https://duckduckgo.com", data={"q": keywords})
File "/opt/conda/lib/python3.9/site-packages/duckduckgo_search/duckduckgo_search.py", line 50, in _get_url
raise DuckDuckGoSearchException(f"_get_url() {url} {type(ex).name}: {ex}")
duckduckgo_search.exceptions.DuckDuckGoSearchException: _get_url() https://duckduckgo.com KeyError: 'https'
Specify this information