Suddenly I get this error message when downloading the Overview for the visible area: Please go to geocaching.com and set the website language to english. The website is and was set to English; yesterday it still worked perfectly. Has Geocaching changed things?
logger.info("Checking if still logged in...") url = 'http://www.geocaching.com/seek/nearest.aspx' page = self.get_reader(url, login = False) for line in page: if 'You are logged in as' in line or 'Hello,' in line or 'LoggedInPanel' in line: self.logged_in = True logger.info("Seems as we're still logged in") page.close() return elif 'You are not logged in.' in line or 'Welcome,' in line or 'LoginPanel' in line: logger.info("Nope, not logged in anymore") page.close() break
page = self.get_reader(url, values, login = False) match=False for line in page: if 'You are logged in as' in line or 'Hello,' in line or 'LoggedInPanel' in line: match=True break elif 'You are not logged in.' in line or 'combination does not match' in line or 'Welcome,' in line or 'LoginPanel' in line: raise Exception("Wrong password or username!") else: logger.info("Seems as if we could not load the web site at all") raise Exception("Something totally went wrong ?!?!") if match==False: logger.info("Seems as if the language is set to something other than english") raise Exception("Please go to geocaching.com and set the website language to english!")
def login_callback(username, password): url = 'http://www.geocaching.com/login/default.aspx' values = {'ctl00$ContentBody$tbUsername': username, 'ctl00$ContentBody$tbPassword': password, 'ctl00$ContentBody$cbRememberMe': 'on', 'ctl00$ContentBody$btnSignIn': 'Login', '__EVENTTARGET': '', '__EVENTARGUMENT': '' } return url, values