Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion goose/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
limitations under the License.
"""
import urllib2

import cookielib

class HtmlFetcher(object):

Expand All @@ -37,6 +37,10 @@ def get_html(self, config, url):
"""
if isinstance(url, unicode):
url = url.encode('utf-8')

cookiejar = cookielib.LWPCookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookiejar))
urllib2.install_opener(opener)

headers = {'User-agent': config.browser_user_agent}
request = urllib2.Request(url, headers=headers)
Expand Down