Skip to content

Instantly share code, notes, and snippets.

@the5fire
Created July 16, 2013 01:28
Show Gist options
  • Save the5fire/6005051 to your computer and use it in GitHub Desktop.
Save the5fire/6005051 to your computer and use it in GitHub Desktop.
# coding:utf-8
import requests
listurl = "http://www.xs8.cn/shuku/c0-t0-f0-w0-u0-o0-1-0.html"
headers = {
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Encoding': 'gzip,deflate,sdch',
'Accept-Language': 'zh-CN,zh;q=0.8,en-US;q=0.6,en;q=0.4',
'Cache-Control': 'max-age=0',
'Connection': 'keep-alive',
'Host': 'www.xs8.cn',
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/28.0.1500.52 Chrome/28.0.1500.52 Safari/537.36'
}
req = requests.get(listurl, headers=headers)
open('result.html', 'w').write(req.content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment