Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jonathanmooredigital/667955e13965c1daa487796f76e11072 to your computer and use it in GitHub Desktop.
Save jonathanmooredigital/667955e13965c1daa487796f76e11072 to your computer and use it in GitHub Desktop.
Screaming Frog Lazy-Loading Custom Extraction Config
# TIPS
1) Remove the count function and paste into dev tools to test further
2) To spot additonal oportunities swap the img selector to video, iframe or wildcards
3) Render JS in SF to discover all images and spot differences
4) Spot check source to find different lazy loading libraries e.g. Lazysizes, JQuery Lazy, yall.js etc
# CAVEATS
1) Don't forget to check background CSS images
2) Other implimentaiton techniques may exist, adapt this approach to suit your needs e.g yall.js - lazy-bg-loaded
-----------
1) All images
-----------
count(//img)
-----------
2) All lazy-loaded images
-----------
count(//img[contains(@loading,'lazy') or contains(@class,'lazy') or contains(@class,'lazyloaded')])
-----------
3) Images not lazy-loaded
-----------
count(//img[not(contains(@loading,'lazy') or contains(@class,'lazy') or contains(@class,'lazyloaded'))])
-----------
4) Loading lazy attribute
-----------
count(//*[contains(@loading, 'lazy')])
-----------
5) Lazy class
-----------
count(//*[contains(@class, 'lazy')])
-----------
6) Lazyloaded class
-----------
count(//*[contains(@class, 'lazyloaded')])
-----------
7) Data-lazy attribute
-----------
count(//@*[contains(name(),'data-lazy')])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment