1、途虎数据怎么爬取,弄了半天没有弄懂
2、网址:http://by.tuhu.cn/baoyang/Index.html?pid=VE-GM-S07BT&n=2013&pl=1.5L
3、这个是我的url
4、这个是我的表单
5、代码
import urllib.request
import urllib.parse
url = "http://by.tuhu.cn/baoyang/RecordUserOperation.html"
user_agent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36'
values ={'operationDescription':'scpan','isBaoYangType':'true','isCheckedBaoYangService':'true'}
headers = {'User-Agent':user_agent}
data = urllib.parse.urlencode(values).encode(encoding='UTF8')
req = urllib.request.Request(url,data,headers)
response = urllib.request.urlopen(req)
the_page = response.read()
print(the_page.decode("utf8"))
是不是因为页面404?