单纯想爬保险公司营业处的资讯
为何传回来的都是空值?
import urllib,urllib2
import re
from time import *
url="https://www.nanshanlife.com.tw/NanshanWeb/branches/query"
request = urllib2.Request(url)
request.add_header("User-Agent","Mozilla/5.0 (Macintosh; Intel Mac OS X
10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106
Safari/537.36")
request.add_header("Referer","https://www.nanshanlife.com.tw/NanshanWeb/branches/74")
form_data = {
"county":'台北市',
"town":'信义区'
}
form_data = urllib.urlencode(form_data)
response = urllib2.urlopen(request,data=form_data)
html=response.read()
print html