Puppeteer

“Requested device not found” when using chrome.tabCapture.capture

南楼画角 提交于 2020-01-06 14:01:52
问题 Problem I want to capture the audio output of a tab automatically. I'm currently thinking of doing this using Puppeteer (headful), by loading an extension that uses chrome.tabCapture.capture . From my Puppeteer script, I evaluate code within the extensions background.js to get the tab capture started. However, chrome.runtime.lastError.message is set to Requested device not found . The extension works as expected outside of Puppeteer and in a Chrome browser. Any idea why I'm getting Requested

Puppeteer script suddenly stopped working after upgrading Puppeteer

半城伤御伤魂 提交于 2020-01-06 12:30:13
问题 I have a puppeteer script I run to reboot my modem. It has worked for I guess about a year with no problem. 5 days ago it stopped working. I was looking into it and realized that I am getting errors I didn't used to get when running it and the script fails. The thing is I didn't change anything. As far as I can see, the HTML hasn't changed either yet it is failing. So I wonder if there is a bug in chromium or puppeteer or if it handles things differently somehow? Here's a codepen with https:/

Puppeteer script suddenly stopped working after upgrading Puppeteer

笑着哭i 提交于 2020-01-06 12:28:25
问题 I have a puppeteer script I run to reboot my modem. It has worked for I guess about a year with no problem. 5 days ago it stopped working. I was looking into it and realized that I am getting errors I didn't used to get when running it and the script fails. The thing is I didn't change anything. As far as I can see, the HTML hasn't changed either yet it is failing. So I wonder if there is a bug in chromium or puppeteer or if it handles things differently somehow? Here's a codepen with https:/

Not all DOM content is ready after waitUntil: 'domcontentloaded'

北城余情 提交于 2020-01-06 07:55:32
问题 Maybe I'm interpreting domcontentloaded wrong, but I expect all elements to be accessible at that time, and I shouldn't have a problem querying for them. Consider the following: await page.goto(url, { waitUntil: 'domcontentloaded' }); const elements = await page.$$('#myId'); elements.length is 0 in this case, but if I wait for the selector before querying, elements now contains the element: await page.goto(url, { waitUntil: 'domcontentloaded' }); await page.waitForSelector('#SignIn-emailInput

Not all DOM content is ready after waitUntil: 'domcontentloaded'

你离开我真会死。 提交于 2020-01-06 07:55:27
问题 Maybe I'm interpreting domcontentloaded wrong, but I expect all elements to be accessible at that time, and I shouldn't have a problem querying for them. Consider the following: await page.goto(url, { waitUntil: 'domcontentloaded' }); const elements = await page.$$('#myId'); elements.length is 0 in this case, but if I wait for the selector before querying, elements now contains the element: await page.goto(url, { waitUntil: 'domcontentloaded' }); await page.waitForSelector('#SignIn-emailInput

Should I use puppeteer as part of my backend?

柔情痞子 提交于 2020-01-06 07:31:27
问题 Lets say I want to create a front-end where multiple users can send a request to a server that scrapes some links off a website, would puppeteer be able to process it concurrently/atleast fast enough or should I consider a different method? Also, is there any possible way to load a page in a headless browser instance(with js enabled) on a mobile device? How could I go about coding my own headless browser in javascript if its possible? 回答1: You can always deploy your node.js instance via PM2

Fetch rendered font using Chrome headless browser

断了今生、忘了曾经 提交于 2020-01-03 03:27:28
问题 I have been looking through the Chrome headless browser documentation but unable to found this information so far. Is it possible to capture the rendered font on a website? This information is available through the Chrome dev console. 回答1: Puppeteer doesn't expose this API directly, but it's possible to use the raw devtools protocol to get the "Rendered Fonts" information: const puppeteer = require('puppeteer'); (async () => { const browser = await puppeteer.launch() const page = await

Memory leak in express.js api application

心不动则不痛 提交于 2020-01-03 03:23:07
问题 I am running an express.js application, which is used as a REST api. One endpoint starts puppeteer and test my website with several procedures. After starting the application and the continuous consumption of the endpoint, my docker container runs out of memory every hour as you can see below. First, I thought I have a memory leak in my puppeteer / headless chrome, but I then I monitored the memory usage from the processes, there isn't and memory leak visible as you can see here: 0.00 Mb

puppeteer-cluster: queue instead of execute

风格不统一 提交于 2020-01-02 19:27:22
问题 I'm experimenting with Puppeteer Cluster and I just don't understand how to use queuing properly. Can it only be used for calls where you don't wait for a response? I'm using Artillery to fire a bunch of requests simultaneously, but they all fail while only some fail when I have the command execute directly. I've taken the code straight from the examples and replaced execute with queue which I expected to work, except the code doesn't wait for the result. Is there a way to achieve this anyway

Puppeteer confirm

五迷三道 提交于 2020-01-02 05:40:07
问题 I am trying to learn puppeteer. I have successfully scripted a login to a page and some navigation. Then I have it click on a button. The page throws up a window.confirm and I want my script to accept this to continue to the next step but I can’t figure out how. Can anyone point me in the right direction? 回答1: Just done a simple test here, when a dialog box comes up on confirm. Simply pressing enter will close the dialog. So what we can do in puppeteer, is do exactly that. I knocked up a