question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scraper returns incomplete information for get_page_info

See original GitHub issue

The scraping works fine for some pages but for some, it retrieves less information such as the following:

This code snippet below (page: atebeyandsell)

from facebook_scraper import *
from pprint import pprint

set_cookies("fb_cookie.txt")
set_user_agent("Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)")
pprint(get_page_info('atebeyandsell'))

Returns the following

{'about': 'Entrepreneur · Gaming Video Creator\n'
          'Send message\n'
          'ᴅɪsᴄᴏᴜɴᴛᴇᴅ ɢᴀᴍᴇ ᴄʀᴇᴅɪᴛs sᴇʟʟᴇʀ.\n'
          'ᴛʀᴜsᴛᴇᴅ & ᴀʟᴡᴀʏs ʀᴇᴄᴏᴍᴍᴇɴᴅᴇᴅ.\n'
          'ᴀʟʟ ᴛʀᴀɴsᴀᴄᴛɪᴏɴs ᴀʀᴇ sᴀғᴇ ᴀɴᴅ ʟᴇɢɪᴛ ✨\n'
          '1 Video\n'
          'atebeyofficial@gmail.com\n'
          'http://instagram.com/atebeyofficial',
 'likes': 6613,
 'profile_photo': 'https://scontent.fmnl17-3.fna.fbcdn.net/v/t1.6435-9/fr/cp0/e15/q65/164655260_107316611452835_8528683889612977791_n.jpg?_nc_cat=110&ccb=1-5&_nc_sid=ed5ff1&efg=eyJpIjoidCJ9&_nc_eui2=AeH1BAfJPhyOlrPCVM-i5RSMckwgHk9sgqFyTCAeT2yCoRsyBrnuYXXkf8OdF8DXgEHEC2SHH_Dx7Ks7cSHtfxxq&_nc_ohc=WOM3rj6xiC0AX8NlL45&_nc_ht=scontent.fmnl17-3.fna&oh=00_AT_TJvBiiaShuD4E74ffQ4HYWksfET86ScTYY9KPCvps7Q&oe=6232C265',
 'reviews': <generator object FacebookScraper.get_page_reviews at 0x7fcb2007b350>}

Meanwhile, this code snippet (page: panglaofooddelivery)

from facebook_scraper import *
from pprint import pprint

set_cookies("fb_cookie.txt")
set_user_agent("Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)")
pprint(get_page_info('panglaofooddelivery'))

Returns the following

{'reviews': <generator object FacebookScraper.get_page_reviews at 0x7fcb300bfc10>}

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
neon-ninjacommented, Mar 29, 2022

It looks like that issue occurs if you don’t pass cookies. https://github.com/kevinzg/facebook-scraper/commit/1531ba91acca8ae6ddbfcffe8a16b70c2d191aab should fix it

1reaction
neon-ninjacommented, Feb 17, 2022

Clicking the “Log Out” button on Facebook invalidates those cookies. So if you’re switching accounts by signing out of one account and signing into another, you’re invaliding those cookies. A good workaround is to use incognito mode, and closing the browser to clear cookies without invalidating them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scraping incomplete tags using python and BeautifulSoup
Attempting to scrape this site url using urllib2, mechanize and BeautifulSoup. When rendered through a browser and viewed using FireBug we ...
Read more >
kevinzg/facebook-scraper: Scrape Facebook public ... - GitHub
Group posts may be missing some fields like time and post_url . Group scraping may return only one page and not work on...
Read more >
My scrapping is always having incomplete data - Web Scraper
Hey guys, Please help me, I was trying to scrape a URL with site fairprice -singapore and selecting dettol as product.
Read more >
The Java Web Scraping Handbook | ScrapingBee
There is no need to scrape a website to fetch this information since there are ... and the third issue is that the...
Read more >
Web Scraping in Python: Avoid Detection Like a Ninja
Learn how to scrape any website without getting blocked or blacklisted while ... but there is usually no public information about them.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found