Skip to content

Commit

Permalink
dump HTML if login fails
Browse files Browse the repository at this point in the history
  • Loading branch information
neon-ninja committed Aug 22, 2021
1 parent bb7135e commit cedc61f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions facebook_scraper/facebook_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,8 @@ def login(self, email: str, password: str):
if "The password that you entered is incorrect" in response.text:
raise exceptions.LoginError("The password that you entered is incorrect")
if 'c_user' not in self.session.cookies:
with open("login_error.html", "w") as f:
f.write(response.text)
raise exceptions.LoginError("Login unsuccessful")

def is_logged_in(self) -> bool:
Expand Down

0 comments on commit cedc61f

Please sign in to comment.