我的测试代码是:
# encoding=utf-8
import requests
headers = {
'
Host':'www.crunchbase.com',
"Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"User-Agent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0",
"Upgrade-Insecure-Requests":"1",
"Accept-Encoding":"gzip, deflate, br",
"Accept-Language":"en-US,en;q=0.5",
"Connection":"keep-alive",
}
url="https://www.crunchbase.com/sitemap/organizations/4a5eb6a619f10f89ea9cccd15c6fa38f-eb176350a92046f2425523ca58f58ce6"
try:
page1 = requests.get(
url=url,headers=headers,
)
print page1.content
print "--------------------"
print page1.headers
print "--------------------"
print page1.request.headers
print "--------------------"
print page1.status_code
except Exception, e:
print e