From c3941f634cdf043c458bd0e2d87fd9714ddf8d85 Mon Sep 17 00:00:00 2001 From: Lasse Server Date: Sun, 21 Nov 2021 10:25:41 +0100 Subject: [PATCH] Issue with login --- facebook/classes.py | 2 ++ facebook/scrapers.py | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/facebook/classes.py b/facebook/classes.py index 4c03070..a89e2a4 100644 --- a/facebook/classes.py +++ b/facebook/classes.py @@ -238,11 +238,13 @@ class Profile: print("Loggade in.") sleep_(2) self.open(url_bas) + sleep_(2) except TypeError: try: write_error(11, self, soup=soup, profile=self.name) except: + print('KUNDE INTE LOGGA IN') pass def update_cookie(self, cookie): diff --git a/facebook/scrapers.py b/facebook/scrapers.py index d76e013..cb6df0a 100644 --- a/facebook/scrapers.py +++ b/facebook/scrapers.py @@ -25,9 +25,20 @@ def profile_picture_reactions(profile, user, first_user=False, mode="all"): # Gå till sidan för profilbilder profile.open(user.url_photos) - # print(profile.viewing()) + + + + if 'Log in or sign up to view' in profile.viewing() or 'Log in to Facebook to start sharing' in profile.viewing(): + print('INTE INLOGGAD') + profile.login() + profile.open(user.url_photos) sleep_(4) + + + + + profile = check_profile_status(profile, user) user.name = user.username # Om inte namnet hittas senare