Follow

website scraping is such a nice skill to have

Β· Β· 1 Β· 0 Β· 4

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

Show thread

@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

Smol server part of the pixie.town infrastructure. Registration is approval-based, and will probably only accept people I know elsewhere or with good motivation.