views:

22

answers:

0

Hello!

I am having some trouble using httplib2. When I browse to the page with Google Chrome and save the source the file is about 106kB. When I request the file with httplib2 i only get 99.x kB and there is missing a lot of text in the beginning of the file. Is there some kind of size limit on bytes objects? Am I doing something wrong?

def __init__(self):
    self.url = 'http://somesite.org'
    self.html = ''
    self.BROWSER = 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.63 Safari/534.3'
    self.http = httplib2.Http()
    self.headers = {'Cookie': extract_from_chrome(),
                    'User-Agent': self.BROWSER}
    self.load()

def load(self):
    response, content = self.http.request(self.url, 'PUT', headers=self.headers)
    self.html = content.decode('utf-8')