-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRITICAL - No posts were found! #91
Comments
Have the same issue, checked what's happening by having headless to false I see that the browser doesn't login and the following result is seen on terminal 2024-01-04 16:02:11,918 - facebook_page_scraper.driver_utilities - CRITICAL - No posts were found! Can anyone help to figure out what can be done to figure this out. |
Hi all, i have the same issue when running on ubuntu but not on windows 11! Instead of the usual log in with the x in top right corner of widget we get a seperate page which requires a login before redirecting to the desired page. If there is a way that we could login on then the webdriver would remember that and we would not get this issue, unfortunately everything i tried on this doesnt work. I have managed to solve the issue by coding my own facebook scraper using a chrome driver that can use a specific user data profile, but would prefer to use this if we can get a patch as less for me to maintain :D Thanks |
following on from this, i tried using a UK proxy which worked and produced the desired outcome |
Could you tell the noob like me how to set proxy to UK? |
proxy='exampleproxy:exampleport' |
@ExpiredMeteor6 Yes, using a Chrome profile that is already logged in will unblock you. Unfortunately, I cannot make that feature a part of this project as it claims that it can only scrape data available publicly |
@shaikhsajid1111 is there any exception do you have which i can import in my code to handle the error def scrape_facebook_data(page_names, posts_count=10, browser="firefox", proxy=None, timeout=600, headless=True):
|
@testproto There isn't any custom Exception that it throws when no posts are found. You can write a wrapper function over this with |
It throws error when any page is private so how i can handle that scenario? |
from facebook_page_scraper import Facebook_scraper import logginglogging.basicConfig(level=logging.INFO) # Set the logging level to INFO or higherdef extract_facebook_page_name(url):
def scrape_facebook_data(page_names, posts_count=10, browser="firefox", proxy=None, timeout=600, headless=True):
def getSocialMedia(urls, posts_count=10, browser="firefox", proxy=None, timeout=600, headless=True):
Set up logging configurationExample usage:if name == "main":
|
I used the example you have given.
#import Facebook_scraper class from facebook_page_scraper
from facebook_page_scraper import Facebook_scraper
#instantiate the Facebook_scraper class
page_name = "##MYNAME##"
posts_count = 10
browser = "firefox"
proxy = "" #if proxy requires authentication then user:password@IP:PORT
timeout = 600 #600 seconds
headless = True
meta_ai = Facebook_scraper(page_name, posts_count, browser, proxy=proxy, timeout=timeout, headless=headless)
json_data = meta_ai.scrap_to_json()
print(json_data)
Following messages appear and I get no posts.
2024-01-04 09:53:29,565 - facebook_page_scraper.driver_initialization - INFO - Using:
[WDM] - There is no [win64] geckodriver for browser in cache
[WDM] - Getting latest mozilla release info for v0.34.0
[WDM] - Trying to download new driver from https://github.com/mozilla/geckodriver/releases/download/v0.34.0/geckodriver-v0.34.0-win64.zip
[WDM] - Driver has been saved in cache [C:\Users\Talat Oncu.wdm\drivers\geckodriver\win64\v0.34.0]
2024-01-04 09:54:31,409 - facebook_page_scraper.driver_utilities - CRITICAL - No posts were found!
Exit code: 1
Then I used for NintendoAmerica
#import Facebook_scraper class from facebook_page_scraper
from facebook_page_scraper import Facebook_scraper
#instantiate the Facebook_scraper class
page_name = "NintendoAmerica"
posts_count = 10
browser = "firefox"
proxy = "" #if proxy requires authentication then user:password@IP:PORT
timeout = 600 #600 seconds
headless = True
meta_ai = Facebook_scraper(page_name, posts_count, browser, proxy=proxy, timeout=timeout, headless=headless)
json_data = meta_ai.scrap_to_json()
print(json_data)
The program gives the message
2024-01-04 10:11:18,586 - facebook_page_scraper.driver_initialization - INFO - Using:
[WDM] - Driver [C:\Users\Talat Oncu.wdm\drivers\geckodriver\win64\v0.34.0\geckodriver.exe] found in cache
and waits indefinitely.
The text was updated successfully, but these errors were encountered: