python - twisted.internet.error.TimeoutError:用户超时导致连接失败
问题描述
我正在尝试运行此命令:
scrapy shell "http://www.zomato.com/sao-paulo-sp/restaurants?page=1"
但我得到:
twisted.internet.error.TimeoutError: User timeout caused connection failure: Getting http://www.zomato.com/sao-paulo-sp/restaurants?page=1 took longer than 180.0 seconds..
这是我的scrapy版本:
scrapy version -v
Scrapy : 1.5.1
lxml : 4.2.4.0
libxml2 : 2.9.8
cssselect : 1.0.3
parsel : 1.5.0
w3lib : 1.19.0
Twisted : 18.7.0
Python : 2.7.10 (default, Jul 15 2017, 17:16:57) - [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]
pyOpenSSL : 18.0.0 (OpenSSL 1.1.0f 25 May 2017)
cryptography : 1.9
Platform : Darwin-17.3.0-x86_64-i386-64bit
我怎样才能解决这个问题?
解决方案
您可能遇到连接问题。开始故障排除:
- 你打算使用http还是https?
- 当您将相同的 URL 粘贴到浏览器中时,页面会加载吗?
- 是某种代理后面的scrapy吗?
- 可以
curl -v ...
用来下载页面吗? - 您是否有可能被 zomato 限制/阻止?
推荐阅读
- javascript - 如何在styles.js中更改禁用按钮的颜色
- c# - 没有键为“Conve”的“IEnumerable”类型的 ViewData 项
- django - django 媒体图片网址未显示
- python - 怎么做船拍?
- okta - Okta 小部件和 MFA 的部分登录问题
- python - Python:如何使用 Matplotlib 将文本垂直放置在条形图中
- c - C、wait()返回什么进程?
- python-3.x - 无法从歌词提取器导入 SongLyrics
- linux - hidepid=2 更新后停止工作。内核不支持“每个挂载点”?
- python - 在嵌套数据结构中时,mypy 未检测到泛型类型不匹配