get_parser returns class instead of object
This commit is contained in:
parent
77881978e3
commit
f8e2016d59
2 changed files with 13 additions and 10 deletions
|
|
@ -115,7 +115,8 @@ class BaseBrowser(mechanize.Browser):
|
|||
|
||||
# ------ Browser methods ---------------------------------------
|
||||
|
||||
def __init__(self, username=None, password=None, firefox_cookies=None, parser=get_parser(), history=NoHistory()):
|
||||
def __init__(self, username=None, password=None, firefox_cookies=None,
|
||||
parser=None, history=NoHistory()):
|
||||
mechanize.Browser.__init__(self, history=history)
|
||||
self.addheaders = [
|
||||
['User-agent', self.USER_AGENT]
|
||||
|
|
@ -129,6 +130,8 @@ class BaseBrowser(mechanize.Browser):
|
|||
else:
|
||||
self._cookie = None
|
||||
|
||||
if parser is None:
|
||||
parser = get_parser()()
|
||||
self.parser = parser
|
||||
self.page = None
|
||||
self.last_update = 0.0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue