def login(self, response): ''' Fill out the login form and return the request''' args, url, method = fill_login_form(response.url, response.body, self.login_user, self.login_pass) self.log('Logging in...') return FormRequest(url, method=method, formdata=args, callback=self.confirm_login, dont_filter=True)
def login(self, response): """ Fill out the login form and return the request""" self.log("Logging in...") try: args, url, method = fill_login_form(response.url, response.body, self.login_user, self.login_pass) return FormRequest(url, method=method, formdata=args, callback=self.confirm_login, dont_filter=True) except Exception: self.log("Login failed") # Make this more specific eventually return Request(url=self.start_urls[0], dont_filter=True) # Continue crawling
def login(self, response): ''' Fill out the login form and return the request''' self.log('Logging in...') try: args, url, method = fill_login_form(response.url, response.body, self.login_user, self.login_pass) return FormRequest(url, method=method, formdata=args, callback=self.confirm_login, dont_filter=True) except Exception: self.log('Login failed') # Make this more specific eventually return Request(url=self.start_urls[0], dont_filter=True) # Continue crawling