DEV Community

0 seconds of 25 minutes, 30 secondsVolume 90%
Press shift question mark to access a list of keyboard shortcuts
00:00
00:00
25:30
 
James Bubb
James Bubb

Posted on

3 2

How to make an Open Graph Scraper (Node, XPath, JavaScript)

Originally published here on YouTube.
(Give me a thumbs up and subscribe if you found this useful 🙏).

01:41 App Setup
04:57 Back end
14:07 Front end

— Follow Me —
Twitter: https://www.twitter.com/codebubb
Facebook: https://www.facebook.com/juniordevelopercentral/
Blog: https://www.juniordevelopercentral.com/
— Thanks! —

In the video we're going to make an open graph scraper which could potentially be created in just client-side code however most requests to access a web url would be blocked in the browser so we'll send a request for a URL from a Node.js back end.

The Node server will also parse our open graph data with XPath and reconstruct the data in to a JavaScript object which we can then send to the client as JSON data.

Our VanillaJS front-end will consume the response from our API endpoint and we'll display the open graph data using a simple front-end.

This might not be the kind of app that you create as a standalone project but there might be a need in a larger application to parse some data from an external web page and you can certainly use these principals of using an open graph scraper to get data from a web page into an object to be used in either your server side or client side code.

Check out the rest of the Junior Developer Central Full Stack Apps here: https://www.youtube.com/watch?v=m2ZzRZemc98&list=PLpc_YvcwbxaTSuBQZkJdt7UKsWAC9wyR2

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay