diff --git a/scraper.py b/scraper.py index 7d66606..056b8af 100644 --- a/scraper.py +++ b/scraper.py @@ -37,7 +37,9 @@ def _extract_post_id(item): postIds = item.find_all(class_="_5pcq") post_id = "" for postId in postIds: - post_id = f"https://www.facebook.com{postId.get('href')}" + currlink = postId.get('href') + if currlink.startswith('/'): + post_id = f"https://www.facebook.com{currlink.split('?')[0]}" return post_id