How do I scrape data from a web page? Facebook wants you to stay on its platform forever. They disallow sending a message to all your friends, so you need to get crafty to escape.
How Do I Do It?
If you’re using Google Chrome, it’s straightforward. There are many ways to scrape a web page, but I’m explaining a quick and dirty solution. If you want to escape Facebook, welcome to the club! Try the same method on any web page where you need obfuscated data on a web page.
- Navigate to: https://www.facebook.com/friends/list
- Alternatively, open Facebook and click the Friends tab.
- Scroll slowly until every friend is listed on the page.
- Open the vertical … menu at the top right of Google Chrome.
- Alternatively, press Cmd-Option-i on macOS, and skip the next two steps.
- Choose More Tools
- Choose Developer Tools
Once this is complete, you should have a developer console open.
Paste this code into your console.
const result = $x(
"/html/body/div/div/div/div/div/div/div/div/div/div/div/div/div/div/div/div/div[*]/a/@href"
);
result.map((x) => {
console.log(x);
});
This should log all of your Facebook friend profile page URLs. Now you can save the log and use the data to populate a CSV file and import it into LoopMessage or another tool that automates sending messages.
- Right-click the result line and click Save as…!
You’ve scraped a web page, and now you can make your Facebook exit!
I wish you luck escaping the clutches of Failbook; you’ll need it!
By the way, Fuck Facebook.