Skip to content
Advertisement

Tag: puppeteer

Puppeter delete node inside element

I want to scrape a page with some news inside. Here it’s an HTML simplified version of what I have : I want to get the author and text body of each news, without the blockquote part. So I wrote this code : It works well, but I don’t know how to remove the blockquote part of the “news-body” part,

Puppeteer Cannot read property getElementById of undefined

I’m trying to pass a value to the browser created by the puppeteer, but this error appears: Cannot read property ‘getElementById’ of undefined The error is in this line: what am I doing wrong? Thanks. Answer You can only use getElementById in the page context. Use page.evaluate, eg: That’ll take the the innerHTML of that element, send it back to

Firebase Functions times out when using puppeteer’s browser.newPage()

I have seen others having relatively minor performance problems with puppeteer running on Firebase Functions. In my case, Firebase times out before I can do anything with puppeteer, even with the memory and timeoutSeconds cranked all the way up. Code: Here’s the resulting Firebase Functions log. It takes a few seconds to run puppeteer.launch(), and then browser.newPage() won’t finish at

Puppeteer .click hovers instead of clicking

I am using puppeteer to automatically restart my wifi (Linksys Velop) and I can’t seem to click an anchor tag to make the final dialog pop up. After the element is clicked, the anchor tag looks as if it’s being hovered over, with the blue underline. Here is the relevant markup: I have tried page.click() as well as page.$eval(), changing

puppeteer return value that is selected in dropdown

How can I grab the selected value from a dropdown (the value that is shown on the page) I have the following code. What I get when I run this is: So that’s not working… UPDATE: Since the html page is very long I’ve added it to a fiddle jsfiddle.net/cad231/c14mnp6z The id of the select item is of which I

Advertisement