【发布时间】:2017-06-07 17:49:44
【问题描述】:
我正在尝试使用以下代码抓取 Google 专利。
url = 'https://patents.google.com/?q=usb'
r = requests.get(url)
html_doc = r.text
soup = BeautifulSoup(html_doc)
但是当我尝试检查文档时,使用
print(soup.prettify)
除了这个 https://pastebin.com/Xu81LdfE 之外,我什么也得不到。 我检查了请求状态,它返回 200。我哪里出错了?
【问题讨论】:
-
改用google api?
-
这几乎就像 Google 故意让他们的内容难以抓取......
-
您为什么不使用搜索结果顶部显示的 CSV 下载链接? patents.google.com/xhr/…
-
CSV 下载的内容正好包含我需要的字段,但它显示的结果数量似乎有限。
标签: python web-scraping beautifulsoup python-requests