我正在尝试检索以下URL:http://www.winkworth.co.uk/sale/property/flat-for-sale-in-masefield-court-london-n5/HIH140004。在
import urllib2
response = urllib2.urlopen('http://www.winkworth.co.uk/rent/property/terraced-house-to-rent-in-mill-road--/WOT140129')
response.read()
但是我得到了一个空字符串。当我通过浏览器或者使用cURL来尝试它时,效果很好。你知道怎么回事吗?在
我在使用
requests
库时得到了响应,但在使用urllib2
时没有得到响应,所以我尝试了HTTP请求头。在事实证明,服务器需要一个
Accept
头;urllib2
不发送,requests
和cURL send*/*
。在同时发送一个带有
urllib2
的邮件:演示:
^{2}$服务器出现故障;RFC 2616状态:
相关问题 更多 >
编程相关推荐