在scrapy中无效的主机名错误

Iva*_*ton 2 python hostname scrapy

我是scrapy的新手,遇到了麻烦。当scrapy请求从以下位置下载时:

http://cache.pack.google.com/edgedl/earth/client/GE7/release_7_1_2/GoogleEarth-Win-Bundle-7.1.2.2041.1.exe

我收到一个错误:

Twisted.python.failure.Failure exceptions.ValueError: invalid hostname: r2---sn-ug5onuxaxjvh-n8vs.c.pack.google.com

如何解决这个问题呢?

小智 5

您需要将 http 地址放在引号中。正如这里对于 linux所提到的,您可以将地址放在单引号 '' 中,但对于 Windows 用户“”可能有效。