Skip to content

Instantly share code, notes, and snippets.

@webharvy
webharvy / gist:ce1cb41762565e4080dd5b3059d6b192
Created November 18, 2019 06:44
WebHarvy : thehomeshoppe.com image extraction regex, js code
// JS code to extract high-res images
var thumbs = document.getElementsByClassName('product-gallery--thumbnail');
for(var i=0; i<thumbs.length; i++) {
var thumb = thumbs[i];
var imgURL = thumb.src.replace('x47', 'x700');
thumb.setAttribute('srcset', imgURL);
}
// Regular Expression String to extract multiple images
@webharvy
webharvy / code.js
Created November 18, 2019 05:59
Google Jobs : codes for pagination / collating
// Code for pagination (scroll)
els = document.getElementsByTagName("ul");
el = els[els.length-1];
el.children[el.childElementCount-1].scrollIntoView();
// Code for collating listings