Presentation delivered on 12.04.19, at April's edition of Brighton SEO. Contains an introduction, basic & more advanced usages of Chrome Puppeteer, Headless Chrome & how you can use it to monitor your site!
1 of 210
Downloaded 87 times
More Related Content
BrightonSEO April 2019 - Tom Pool - Chrome Puppeteer, Fake Googlebot & Monitor Your Site!
#38: And effectively crawl single page applications
#39: JS Can be a bit of a pain to work with, but unfortunately, it is not going away!
#40: So Screaming Frog (and a majority of crawling softwares), utilise something like headless chrome to emulate a browser, and provide JS rendering features.
#41: And we all know about issues that Google can have with crawling JS, ranging from having slight issues with rendering, to completely drawing a blank.
#42: So there have been a bunch of JS indexing and rendering case studies over the past couple of years.
#44: We can also use Headless Chrome to automate web page checks, and I provide an in depth investigation to this later on in this deck.
#45: AND it can be used for general webpage testing. Including clicking on stuff, filling in forms, general fuckery with the mouse and keyboard.
#46: It is really good for emulating user behaviour. So great for pretending to be a user, and browsing around a site.
#47: SO it is basically really great for seeing exactly how much shit a website can take before it breaks!
#48: However, the problem with running all of these tasks is
#49: You have to run basic headless chrome through the command line interface
#50: So first you gotta install some dependencies, and have a shit ton of errors hit you in the face, and you gotta know where chrome is stored on your local machine...
#51: Then you gotta run directly from that location
#100: If I wanted to take a screenshotof a single page
#101: So just type in this, and you should be good to go.
#102: So just type in this, and you should be good to go.
#103: So just type in this, and you should be good to go.
#104: You’ll need to code some stuff up - but I’ve put everything together into a single google doc, that makes it simple & easy to understand what each bit does. Exmplain that you are going to go through it.
#105: So we are starting up a headless browser, in true headless mode, so you won’t see what goes on (running in the background)
#116: And then a couple of seconds later, you’ll see
#117: A nice screenshot get added to your folder with your code in
#118: If you wanted to see the browser test this exactly for you,
#119: Just change the headless mode to false. This is great for seeing exactly what the browser sees, and looks pretty cool, having a chrome window doing all sorts of shit in front of you!
#120: Just change the headless mode to false. This is great for seeing exactly what the browser sees, and looks pretty cool, having a chrome window doing all sorts of shit in front of you!
#121: You can also modify the script slightly to run through a list of provided URLs
#154: Maybe You Don’t Wanna Eat Into Your Budget For Content King for a personal project site, or you don’t need the level of detail that those guys provide for a smaller, shitter site?
#155: This Next Example Shows How We Can Use puppeteer to
#156: Monitor a chosen site when you want, and report of any changes to key areas
#174: There are a few really interesting snippets that I’d really like to share, that can come in handy
#175: So we launch headless chrome as highlighted a few minutes ago
#176: Like so. So we launch the browser, and then create a new page within the browser, awaiting for further instruction...
#177: And then we provide a list of URLs for Puppeteer to go and fuck around with
#178: So here we are quoting the file that we will use for this program, we parse (or read it) using a couple more lines, that don’t really look that exciting!
#179: And then we pull in teh relevant meta data that I mentioned