codefuse-chatbot/tests/search_test.py

7 lines
221 B
Python
Raw Normal View History

2023-09-28 10:58:58 +08:00
from duckduckgo_search import DDGS
with DDGS(proxies="socks5h://127.0.0.1:13659", timeout=20) as ddgs:
ddgs._session.headers["Referer"] = ""
2023-09-28 10:58:58 +08:00
for r in ddgs.text("马克龙、冯德莱恩访华"):
print(r)