Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 21 lines (16 sloc) 0.646 kb
import urllib.request
class fake_broswer(urllib.request.Request):
def __init__(self, url):
self.fake_broswer_headers = {
'User-agent': 'Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20100101 Firefox/7.0.1'}
self.url = url
self.request = urllib.request.Request(url, headers = {})
def fbopen(self):
return urllib.request.urlopen(self.request)
def test():
fb = fake_broswer('http://www.douban.com/group/fangzi/')
fb = fb.fbopen()
cont = fb.read()
cont = cont.decode('utf8')
print(cont)
test()
Jump to Line
Something went wrong with that request. Please try again.