totally didn't just steal all of Domino's pizza names, images and descriptions

@f0x how did you learn that skill ? i want to start

Follow

@violet uhh years of doing all sorts of things with the web i suppose

but depending on the task, either quickly write (nested) .querySelectorAll() calls, then just copy the result as a json or Object. Or for more involved or automated stuff, npmjs.com/package/cheerio

code, screenreader unfriendly 

@violet for the dominos case I started by just writing

pizzas = Array.from(document.querySelectorAll(".product-container")).map((product) => {
return {
name: product.querySelectorAll(".menu-entry")[0].textContent,
img: product.querySelectorAll(".pizza-image")[0].src,
comment: product.querySelectorAll(".menu-page-product-description")[0].textContent
}
})

in the browser console while on the menu page, but going to rewrite it to a standalone script that also fetches the full product page in order to get the lengthier description

Sign in to participate in the conversation
Pixietown

Small server part of the pixie.town infrastructure. Registration is closed.