Facebook Scraper currently fails - I've tested trying to return a user (return an error during HTML parsing) and posts (generator returns nothing).
I suspect the issue is bigger, possibly due to changes with the FB profile, but could also be some other connection issue.
How to reproduce
import snscrape.modules.facebook as snfb
import logging
logging.basicConfig(level=logging.DEBUG)
user = snfb.FacebookUserScraper("zuck")._get_entity()
This returns an error.
Similarly,
import snscrape.modules.facebook as snfb
import logging
logging.basicConfig(level=logging.DEBUG)
for i,post in enumerate(snfb.FacebookUserScraper("zuck").get_items()):
print(i, post)
This returns nothing (except the log output from snscrape - the log output is the same as for the above command and is pasted below).
Expected behaviour
Successfully returning User or Post information.
Screenshots and recordings
No response
Operating system
Windows 10 Pro, Version: 21H2, OS build: 19044.2965
Python version: output of python3 --version
3.10.11
snscrape version: output of snscrape --version
0.6.2.20230320
Scraper
facebook-user
How are you using snscrape?
Module (import snscrape.modules.something in Python code)
Backtrace
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[1], line 5
2 import logging
3 logging.basicConfig(level=logging.DEBUG)
----> 5 user = snfb.FacebookUserScraper("zuck")._get_entity()
6 user
File [d:\Anaconda3\envs\smscraping2\lib\site-packages\snscrape\modules\facebook.py:237](file:///D:/Anaconda3/envs/smscraping2/lib/site-packages/snscrape/modules/facebook.py:237), in FacebookUserScraper._get_entity(self)
234 return
236 handleDiv = handleDivPattern.search(r.text)
--> 237 handle = handlePattern.search(handleDiv.group(0))
238 kwargs['username'] = handle.group(1)
240 nameVerifiedMarkup = nameVerifiedMarkupPattern.search(r.text)
AttributeError: 'NoneType' object has no attribute 'group'
The current problem seems to be downstream from the _initial_page() result, which is response.text and soup (essentially). Both these variables, for me, return a logged-out user's view with a prompt to accept cookies. Even if cookies are accepted, I think, still, little information is displayed (e.g. no posts).
Not sure if this is a problem with the connection or somehow the result of some changes to the FB platform. Either way, if you provide hints on how I can help with resolving this, I'd be happy to!
Describe the bug
Facebook Scraper currently fails - I've tested trying to return a user (return an error during HTML parsing) and posts (generator returns nothing).
I suspect the issue is bigger, possibly due to changes with the FB profile, but could also be some other connection issue.
How to reproduce
This returns an error.
Similarly,
This returns nothing (except the log output from
snscrape
- the log output is the same as for the above command and is pasted below).Expected behaviour
Successfully returning User or Post information.
Screenshots and recordings
No response
Operating system
Windows 10 Pro, Version: 21H2, OS build: 19044.2965
Python version: output of
python3 --version
3.10.11
snscrape version: output of
snscrape --version
0.6.2.20230320
Scraper
facebook-user
How are you using snscrape?
Module (
import snscrape.modules.something
in Python code)Backtrace
Log output
Dump of locals
No response
Additional context
Obviously, the HTML parsing fails.
The current problem seems to be downstream from the
_initial_page()
result, which isresponse.text
andsoup
(essentially). Both these variables, for me, return a logged-out user's view with a prompt to accept cookies. Even if cookies are accepted, I think, still, little information is displayed (e.g. no posts).Not sure if this is a problem with the connection or somehow the result of some changes to the FB platform. Either way, if you provide hints on how I can help with resolving this, I'd be happy to!