I am trying to extract data from http://book.libertorrent.com/ , but at the moment I am failing because there are some additional data (headers) in response. My code is very simple:
response = urllib.urlopen('http://book.libertorrent.com/login.php') f = open('someFile.html', 'w') f.write(response.read())
read () returns:
Date: Fri, 09 Nov 2012 07:36:54 GMT Content-Type: text/html; charset=utf-8 Transfer-Encoding: chunked Connection: close Cache-Control: no-cache, pre-check=0, post-check=0 Expires: 0 Pragma: no-cache Set-Cookie: bb_test=973132321; path=/; domain=book.libertorrent.com Content-Language: ru 1ec0 ...Html... 0
And response.info () is empty.
Is there any way to fix the answer?
source share