After seeing this youtube video using puppeteer I got inspired to play a bit around with it. But I seem to have made the wrong choice of a website as a starter project.
const puppeteer = require('puppeteer')
;(async () => {
const browser = await puppeteer.launch()
const page = await browser.newPage()
await page.goto('http://www.produktresume.dk/AppBuilder/search?page=0')
page.once('load', () => {
const drugs = page
.evaluate(() =>
[...document.querySelectorAll('div.entity-link')].map(item => item)
)
.catch(err => console.log(err))
console.log(drugs[0])
})
await browser.close()
})()
I have googled around and lost track of the different things I have tried..
My perception of my problem is that I don't call the evaluate at the right time - when the page is loaded.