scrapy的响应状态为400,但浏览器的响应正常吗?

问题描述 投票:2回答:1

我有这种奇怪的情况,

我有一个链接可用于我目前拥有的所有浏览器(chrome,IE,firefox),我尝试使用scrapy中的python抓取页面。但是我得到response.status == 400,我正在使用tor + polipo进行匿名爬网

response.body是:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<title>Proxy error: 400 Couldn't parse URL.</title>
</head><body>
<h1>400 Couldn't parse URL</h1>
<p>The following error occurred while trying to access <strong>https://exmpale.com/blah</strong>:<br><br>
<strong>400 Couldn't parse URL</strong></p>
<hr>Generated Thu, 11 Dec 2014 13:55:38 UTC by Polipo on <em>localhost:8123</em>.
</body></html>

我只是想知道为什么会这样,难道浏览器可以获取结果但不能获取scrapy

python scrapy polipo
1个回答
0
投票

我的案子:https://www.a.com?a=b是200https://www.a.com/?a=b是400

因此请检查标题和cookie和URL

© www.soinside.com 2019 - 2024. All rights reserved.