moda20 / facebook-scraper

Scrape Facebook public pages without an API key
MIT License
60 stars 23 forks source link

Get video by post not working #44

Open michaelpham888 opened 3 months ago

michaelpham888 commented 3 months ago

Hi bro, I tried to get a video from a post and it's not working, it seems like facebook has adjusted the elements so they're not working properly, please help me check and see if that's true. thansk !

526319491 commented 3 months ago

facebook_scraper/facebook_scraper.py change the 'default_headers ' --> 'User-Agent' : "Mozilla/5.0 (Linux; Android 11.0; Surface Duo) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36"

The above is the solution, but after making such modifications, the structure of the page will change. You need to parse the HTML again, which means you need to understand the source code and be able to modify it