首页 > 解决方案 > 在 Python 中使用 XPath 抓取 G2 - “Pardon Our Interruption”响应

问题描述

我正在尝试使用 Xpath 在 G2 Crowd 中获取页面的标题,似乎 G2 不允许这样做,因为我得到“请原谅我们的中断”。代码只有几行,并且可以与其他站点一起使用,如何解决?

from requests_html import HTMLSession

session = HTMLSession()

resp = session.get("https://www.g2.com/categories/ipaas")

sites = resp.html.xpath("//title/text()")

print(sites)

我是这方面的新手,请协助如何刮G2。谢谢。

标签: pythonxpath

解决方案


推荐阅读