Puppeteer

Is Puppeteer-Cluster Stealthy enough to pass bot tests?

99封情书 提交于 2020-02-02 11:26:23
问题 I wanted to know if anyone using Puppeteer-Cluster could elaborate on how the Cluster.Launch({settings}) protects against sharing of cookies and web data between pages in different context. Do the browser contexts here, actually block cookies and user-data is not shared or tracked? Browserless' now infamous page seems to think no, here and that .launch({}) should be called on the task, not ahead of the queue. So my question is, how do we know if puppeteer-cluster is sharing cookies / data

How to test custom web component with jest?

最后都变了- 提交于 2020-02-01 08:20:13
问题 I would like to test some custom web components and use jest.js as test runner (due to its support for ES6). Chromium supports commands like window.customElements.define('my-custom-element', MyCustomElementClass); to register a custom web component. However, window.customElements does not seem to be known in the context of jest tests. As a work around I tried to use jest in combination with puppeteer and express to run the customElements part in Chromium. However, I have difficulties to

How to test custom web component with jest?

我只是一个虾纸丫 提交于 2020-02-01 08:20:12
问题 I would like to test some custom web components and use jest.js as test runner (due to its support for ES6). Chromium supports commands like window.customElements.define('my-custom-element', MyCustomElementClass); to register a custom web component. However, window.customElements does not seem to be known in the context of jest tests. As a work around I tried to use jest in combination with puppeteer and express to run the customElements part in Chromium. However, I have difficulties to

How can I capture all network requests and full response data when loading a page in Chrome?

孤者浪人 提交于 2020-01-29 02:49:04
问题 Using Puppeteer, I'd like to load a URL in Chrome and capture the following information: request URL request headers request post data response headers text (including duplicate headers like set-cookie ) transferred response size (i.e. compressed size) full response body Capturing the full response body is what causes the problems for me. Things I've tried: Getting response content with response.buffer - this does not work if there are redirects at any point, since buffers are wiped on

Puppeteer error Error: waiting on selector times out

谁说胖子不能爱 提交于 2020-01-25 08:29:30
问题 Currently I have a site that has this in it's HTML. I confirmed it from checking the elements in chrome developer tools. <div class="hdp-photo-carousel" style="transform: translateX(0px);"> <div class="photo-tile photo-tile-large"> I visually watch the page open up and I can see the item is there. Then I get this error AFTER 30 seconds: UnhandledPromiseRejectionWarning: TimeoutError: waiting for selector ".photo-tile" failed: timeout 30000ms exceeded My code in puppeteer js for this is: await

limit scope to an array of elementHandles (for selection/click/etc)

为君一笑 提交于 2020-01-25 06:59:08
问题 I'm using --> arrayOfHandles = await page.$x({SOME XPATH EXPRESSION}); To create an array of elementHandles to loop through and limit scope in the loop to each Handle: But It is not working!!!!! Given the following snippet of code: <div class="cameraList"> <div class="camera-row"> <div class="statsRow"> <div class="checkbox checkbox-primary"> <input id="Entrance" type="checkbox" readonly=""> </div> <div class="hasLocationIcon"> <svg version="1.1" id="locationChecked"></svg> </div> <div title=

Define default width of Chrome DevTools window

余生长醉 提交于 2020-01-24 21:48:15
问题 Is there a way to give chrome a default width for the devtools window. As it is now, when I start chrome and open DevTools it takes about half the window width. Ideally I would do something like $> /Applications/Google Chrome.app/Contents/MacOS/"Google Chrome" --devtools-width=300 and tell it what the width is. To give a bit of context, I'm running Puppeteer which, in my case, opens DevTools when it starts the browser. But its too wide for me, I need to resize it everytime. Here is my

Define default width of Chrome DevTools window

≡放荡痞女 提交于 2020-01-24 21:47:05
问题 Is there a way to give chrome a default width for the devtools window. As it is now, when I start chrome and open DevTools it takes about half the window width. Ideally I would do something like $> /Applications/Google Chrome.app/Contents/MacOS/"Google Chrome" --devtools-width=300 and tell it what the width is. To give a bit of context, I'm running Puppeteer which, in my case, opens DevTools when it starts the browser. But its too wide for me, I need to resize it everytime. Here is my

Puppeteer finds the element in the wrong tab

家住魔仙堡 提交于 2020-01-24 20:41:05
问题 When ever I tried to click on the product, it opens in a new tab, where I perform text content operation. It returns null as puppeteer is searching the element in wrong tab const puppeteer = require('puppeteer'); (async () => { const browser = await puppeteer.launch({ "headless": false, // "slowMo": 50, args: ['--start-fullscreen'], defaultViewport: null }); //Page const page2 = await browser.newPage(); let username = "g.rajesh690@gmail.com"; let password = "Nation20"; await page2.goto('https

How to use puppeteer in vue.js

狂风中的少年 提交于 2020-01-24 20:21:07
问题 I'm trying to integrate puppeteer in a vue.js application to generate screenshots and pdf files. I have write a function that use puppeteer to generate a screenshot, works perfectly. export const MyScripts = { getMiniature : async function(elementId, key) { const puppeteer = require('puppeteer'); const browser = await puppeteer.launch(); const page = await browser.newPage(); // Making a screenshot } } When trying to integrate that function, it fails to load puppeteer. The 'require' doesn't