- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
在“避免被禁止”标题下,Scrapy documentation advises :
if possible, use Google cache to fetch pages, instead of hitting the sites directly
指的是http://www.googleguide.com/cached_pages.html ,最后更新于 2011 年。
我正在尝试这样做,以抓取一个需要我无法绕过的验证码的网站。然而,谷歌随后又产生了同样的问题。
我使用这个中间件让蜘蛛停留在链接的 Google 缓存版本上:
class GoogleCacheMiddleware(object):
def process_request(self, request, spider):
if spider.use_google_cache == True and 'googleusercontent' not in request.url:
new_url = 'https://webcache.googleusercontent.com/search?q=cache:' + request.url
request = request.replace(url=new_url)
return request
在蜘蛛本身中,我使用以下设置礼貌地爬行:
custom_settings = {
'AUTOTHROTTLE_ENABLE' :True,
'CONCURRENT_REQUESTS' : 2, # or 1
'DOWNLOAD_DELAY' : 8 # increased this to as much as 10
}
我还尝试在原始网站和该网站的 Google 缓存版本上使用 Selenium。这有时会成功爬取几分钟并返回数据,但最终会落在 https://support.google.com/websearch/answer/86640。 ,其中指出 Google 从您的计算机网络检测到“异常流量”,并需要验证码才能继续。
Scrapy 文档似乎与 Google 使用条款有冲突,我说的对吗?无论哪种方式,是否有推荐的方法来绕过验证码,或者尽管有此限制,还是从网站的 Google 缓存中完成抓取?
更新,7-9-18:
当这个蜘蛛在一周或更长时间内运行几次时,它最终会产生完整或更完整的结果,这显然是因为最初抓取的 URL 在每次抓取时都会发生变化并在验证码启动之前成功。如果有人知道与文档或特定的解决方法。
最佳答案
我不太熟悉 Scrapy,但似乎该网站一定是阻止了缓存 View 。您是否尝试过使用 https://www.seoweather.com/google-cache-search/ 检查缓存?
不过,如果您要使用代理,最好是反向连接代理,那么您可以绕过 Google 的屏蔽,因为在抓取 Google 时您会需要很多东西。
另一种选择可能是尝试抓取 https://archive.org/web/页面的版本?事实上,他们甚至有一个你可以使用的 API https://archive.org/help/wayback_api.php
关于python - 在网站的谷歌缓存上使用 Scrapy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50555545/
我有这个网站,这个特定页面是安全的,但是当它回发时,它回发到一个不安全的页面。如何解决? 我正在使用 ASP.NET 向导。我有这个页面 - checkout.aspx,页面包含这个控件 checko
我有 2 个 azure 网站 - 两个独立的项目 我现在有 2 个网址: myazurewebsite.azurewebsites.net myazureblog.azurewebsites.net
我有 2 个 azure 网站 - 两个独立的项目 我现在有 2 个网址: myazurewebsite.azurewebsites.net myazureblog.azurewebsites.net
环境: 旧网站: React 托管在 Heroku URL( http://sameurl.com ) 新网站: Java 托管在 Heroku URL ( http://sameurl.com )
我已在 Windows Azure 上注册了一个测试帐户来对其进行测试。我构建了一个 Hello world ASP.NET Web 应用程序 + 数据库只是为了测试。 我安装了 Visual Stu
我有一个可以收集和显示各种测量值的产品(不会详细介绍)。正如人们所期望的那样,显示部分是一个数据库+建立在其之上的网站(使用 Symfony)。 但是,我们可能还会创建一个 API 来向第三方公开数据
这个问题在这里已经有了答案: Software keyboard resizes background image on Android (16 个答案) 关闭 8 年前。 我有一个类似的问题:So
这个问题似乎很常见,但我真的无法根据现有答案解决问题。 我有一个简单的 maven 项目,没有任何复杂的部署配置等,并且想在点击“mvn site”时生成一个 Maven CheckStyle 报告。
有没有人看过有关何时进行横向扩展与纵向扩展的最佳选择的任何分析或信息。什么时候一个比另一个更有意义。 目前,在标准模式和基本模式下,2 个小型实例的费用与 1 个中型实例的费用相同。 拥有 2 个小型
有没有办法找到 azure 网站何时停止? (我通过门户网站停止了网站,但我不记得是什么时候......) 我正在寻找一些日志,但没有找到任何有用的内容。 谢谢。 最佳答案 您拥有的最接近的是 azu
我目前在 Azure VM 的 IIS 中拥有一个网站。我已将该站点复制到 2 个可用区域中的 2 个虚拟机上。 这可以保护网站免遭停机。 我需要为高负载时刻实现一些可扩展性。这似乎就是创建音阶集的目
我有一个托管在 Azure 上的网站 ( http://mike-ward.azurewebsites.net/ )。我从 Azure 门户设置了一个指向(引用?)我的网站的 Azure CDN。根据
我有一个 Azure 网站(不是 Web 角色),有 2 个槽:生产和暂存。 我只想为生产插槽启用 CDN,而不是为登台启用,问题是我找不到识别主机插槽的方法。 RoleEnvironment 不可用
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提出有关书籍、工具、软件库等建议的问题。您可以编辑问题,以便可以用事实和引用来回答它。 4年前关
我们正在考虑将一些网站从 Azure 云服务迁移到 Azure 网站(事情似乎就是这样进行的)。显然,我们被明确告知云服务不会保留文件系统状态,因为它们会在机器故障时重新部署。 我假设网站是基于 Bl
我有一个 Azure 网站,需要使用在 VM 上运行的 Elasticsearch 服务。 虽然我需要能够锁定对 Elasticsearch 的访问,以便只有 Azure 网站可以访问它,但我似乎无法
我有一个 azure 网站,位于 yis3.azurewebsites.net - 我已将其提升为“共享”网站,以便我可以使用自定义域。我拥有从 123-reg.co.uk 购买的域名 yorkshi
我正在使用 abcPDF 动态创建 PDF。 我想保存这些 PDF,以便客户随时检索。最简单的方法(也是我现在在当前服务器上所做的方法)是将完成的 PDF 保存到文件系统。 看来我一直坚持使用 blo
我们正在尝试了解 Windows Azure 管理 API 为 Azure 网站(而非 Webroles)返回的监控数据的复杂性 例如,下图描述了为 CPUTime 检索的数据点。它似乎表明,在晚上
看起来真的很愚蠢,因为我找不到它: 门户网站似乎不太直观,我如何为一个“网站”付费并在其中运行最多 500 个网站?我想当我通过单击左下角的加号添加“网站”时,我添加了整个虚拟机而不是子站点。如何仅添
我是一名优秀的程序员,十分优秀!