【```python】import urllib.request, urllib.parse, time, re

query = "广州医科大学附属第一医院 骨科 医生 列表"
url = "https://html.duckduckgo.com/html/?q=" + urllib.parse.quote(query)
req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/120 Safari/537.36"})
try:
html = urllib.request.urlopen(req, timeout=20).read().decode("utf-8", errors="ignore")
print(len(html))
extract result titles and snippets
for m in re.finditer(r'result__a.?>(.?).?result__snippet.?>(.?)', html, re.S):
print("TITLE:", re.sub(r'<.?>', '', m.group(1)).strip())
print("SNIPPET:", re.sub(r'<.?>', '', m.group(2)).strip()[:500])
print("")
except Exception as e:
print("ERROR:", e)
```
【参考文献】