Back to articles
How to Build a Custom SEO Audit Tool with Web Scraping

How to Build a Custom SEO Audit Tool with Web Scraping

via Dev.to WebdevАлексей Спинов

SEO audit tools charge $50-200/month. Build your own for free. What to Check async function auditPage ( url ) { const res = await fetch ( url ); const html = await res . text (); const $ = require ( " cheerio " ). load ( html ); return { url , statusCode : res . status , title : $ ( " title " ). text (), titleLength : $ ( " title " ). text (). length , metaDescription : $ ( " meta[name=description] " ). attr ( " content " ) || " MISSING " , h1Count : $ ( " h1 " ). length , h1Text : $ ( " h1 " ). first (). text (), imagesMissingAlt : $ ( " img:not([alt]) " ). length , totalImages : $ ( " img " ). length , internalLinks : $ ( " a[href^=/] " ). length , externalLinks : $ ( " a[href^=http] " ). length , wordCount : $ ( " body " ). text (). split ( / \\ s+/ ). length , hasCanonical : !! $ ( " link[rel=canonical] " ). length , hasRobotsMeta : !! $ ( " meta[name=robots] " ). length , loadTime : Date . now () - startTime }; } Checks Covered Title tag (present, length 50-60) Meta description (p

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
7 views

Related Articles