@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, https://www.npmjs.com/package/cheerio
@f0x thanks !
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
@violet and sometimes just a regex is all you need https://git.pixie.town/f0x/woei/src/branch/main/index.js#L43-L55