new API in BaseBackend to create browser

This commit is contained in:
Romain Bignon 2010-05-20 10:39:49 +02:00
commit c1279aa496
12 changed files with 84 additions and 87 deletions

View file

@ -148,7 +148,12 @@ class BaseBrowser(mechanize.Browser):
# Use a proxy
if proxy:
self.set_proxies({"http": proxy})
proto = 'http'
if proxy.find('://') >= 0:
proto, domain = proxy.split('://', 1)
else:
domain = proxy
self.set_proxies({proto: domain})
# Share cookies with firefox
if firefox_cookies and HAVE_COOKIES: