A deep dive into Screaming Frog’s JavaScript snippets for SEO
This presentation explores Screaming Frog’s new JavaScript snippet feature and how SEOs can use it to automate tasks, extract data, and integrate AI tools like ChatGPT.
write using natural language. You can also code. • Use your favourite LLM to generate the custom JavaScript: 3 A Deep Dive into Screaming Frog’s JavaScript Snippets for SEO
SEO What are JavaScript snippets? They are snippets of JavaScript code that you can run on processed URLs during a crawl. IMPORTANT • Only 200 OK URLs • Only HTML (no PDFs)
Snippets for SEO You can do things like: • Extract custom data from a webpage • Communicate with APIs such as ChatGPT or other libraries. • Modify or clean up data Screaming Frog system snippets
SEO But that’s okay Screaming frog is designed to be an accessible SEO crawler first. If you have more advanced scraping requirements, use more suitable tools.
SEO Gemini’s Response Claude’s Response 2. Make simultaneous API calls to Gemini and Claude with the product data and ask the LLMs to produce an improved version. Here are the results ->
SEO You know, not bad but I'm surprised. Gemini crushed it and was a 9/10. I thought you were the better LLM? What's going on. For reference, here is the product description that you came up with: claudeDesc And here is what Gemini wrote as an FYI: geminiDesc See if you can do better. 3. Follow it up with another API call to Claude with a “jealousy” prompt Prompt concept by Greg Isenberg
SEO I use a "treewalker" to scrape the page, which refers to the TreeWalker API in JavaScript. • It provides methods to navigate the Document Object Model (DOM ) tree in various directions (forward, backward, up, down). • It's a powerful tool within the DOM that allows you to travel across and filter nodes within a webpage's HTML structure.
SEO What else can we do with the script? - Make the chunking more dynamic. - Identify if a page already contains an internal link to our destination URL. - Send the filtered output to an LLM for anchor text or sentence replacement suggestions. - Use the same methodology to chunk and convert to embeddings. Potentially even push to a vector database with an API.