url:http://item.jd.com/2967929.html

    1. import requests
    2. url = 'http://item.jd.com/2967929.html'
    3. try:
    4. r = requests.get(url)
    5. r.raise_for_status()
    6. r.encoding = r.apparent_encoding
    7. print(r.text[:1000])
    8. except:
    9. print("error!")