def request(self,url):
"""
Send request to the http server.
"""
from core.shell import user_agent
opener = urllib2.build_opener()
opener.addheaders = [('User-Agent', user_agent),
("Accept", "text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1"),
#("Accept-Language","en-US,en;q=0.9,en;q=0.8"),
#("Accept-Encoding", "gzip;q=0,deflate,sdch"),
#("Accept-Charset", "ISO-8859-2,utf-8;q=0.7,*;q=0.7"),
("Keep-Alive", "115"),
("Connection", "keep-alive"),
("DNT", "1")]
return opener.open(self.url).read()
评论列表
文章目录