Skip to content

Commit ca5fb04

Browse files
Merge pull request #208 from BelKed/captcha-problems
Add an error case for CAPTCHA problems
2 parents 89feb55 + e812239 commit ca5fb04

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pycaching/geocaching.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ def login(self, username=None, password=None):
155155
return
156156
else:
157157
self.logout()
158+
159+
if after_login_page.find("div", class_="g-recaptcha"):
160+
raise LoginFailedException("CAPTCHA is required to login to the site.")
161+
158162
raise LoginFailedException("Cannot login to the site (probably wrong username or password).")
159163

160164
def _load_credentials(self, username=None):

0 commit comments

Comments
 (0)