Puppeteer

puppeteer : wait for ajax call after navigation [duplicate]

只谈情不闲聊 提交于 2021-01-29 06:30:43
问题 This question already has an answer here : how to handle elements that load after ajax request in puppeteer (1 answer) Closed 2 years ago . so in my code i submit a form , wait for navigation and submit a second form ... here is the tricky part ... before the second from submit some data will be loaded in the from with ajax i want to wait for those ajax call the be done and then submit the second form here is a simplified version of my code await Promise.all([ page.click('#form1_submit'),

puppeteer : wait for ajax call after navigation [duplicate]

北战南征 提交于 2021-01-29 06:21:54
问题 This question already has an answer here : how to handle elements that load after ajax request in puppeteer (1 answer) Closed 2 years ago . so in my code i submit a form , wait for navigation and submit a second form ... here is the tricky part ... before the second from submit some data will be loaded in the from with ajax i want to wait for those ajax call the be done and then submit the second form here is a simplified version of my code await Promise.all([ page.click('#form1_submit'),

Click event does nothing when triggered

强颜欢笑 提交于 2021-01-29 03:20:44
问题 When I trigger a .click() event in a non-headless mode in puppeteer, nothing happens, not even an error.. "non-headless mode so i could visually monitor what is being clicked" const scraper = { test: async () => { let browser, page; try { browser = await puppeteer.launch({ headless: false, args: ["--no-sandbox", "--disable-setuid-sandbox"] }); page = await browser.newPage(); } catch (err) { console.log(err); } try { await page.goto("https://www.betking.com/sports/s/eventOdds/1-840-841-0-0,1

How to iterate through a supermarket website and getting the product name and prices?

会有一股神秘感。 提交于 2021-01-29 02:16:07
问题 Im trying to obtain all the product name and prices from all the categories from a supermarket website, all the tutorials that i have found do it just for one const url, i need to iterate through all of them. So far i have got this const puppeteer = require('puppeteer'); async function scrapeProduct(url) { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.goto(url); const [el2] = await page.$x('//*[@id="product-nonfood-page"]/main/div/div/div[1]/div[1]

What kind of dialog box is this? How can I interact with it using Puppeteer?

匆匆过客 提交于 2021-01-28 21:22:38
问题 I'm using puppeteer to run a Google Chrome browser(I've tried with Chromium as well), to generate a PDF and then I'm using the URL to send the PDF to some other software. I'm getting stuck at this dialog box of sorts. I assumed it was a normal dialog box and have tried the usual method of hitting the "confirm" button. I can't seem to get it to work. I'm unable to show you the URL I am using the get this to show up, as it is sensitive. As I mentioned, page.on() doesn't seem to catch the box.

Trouble modifying an object within page.evaluate in Puppeteer

爱⌒轻易说出口 提交于 2021-01-28 20:00:24
问题 I am creating a Twitter scraper as a project. Tweets are rendered in the DOM as you scroll down so I want to use Puppeteer to scroll, extract data and save it into a predefined object, then continue scrolling. The problem is that the script is not actually modifying the object provided and I am left with an empty object. The for loop to extract data works when called outside the scrolling function (i.e. I can extract the first tweets rendered in the page). The scrolling function itself works,

How does Puppeteer handle the click Object / DevTools Protocol Chromium/Chrome

天涯浪子 提交于 2021-01-28 19:37:59
问题 I need to know how puppeteer handles the click object, as well as Chromium DevTools API. I've tried to research it on my own and have found myself not being able to find the actual code that handles it. The reason why I need to know is I'm developing a wrapper that tests events in code for testing Web Pages, and was looking to see if implementing a event handling routine is beneficial instead of using puppeteers interface of events (clicks and taps an hover, as well as other events that might

Cannot join the conference created by lib-jitsi-meet in a headless browser

允我心安 提交于 2021-01-28 09:00:44
问题 I'm trying to create a conference using lib-jitsi-meet in a headless Chrome instance using Puppeteer and join it using the Jitsi External API (iframe API) from another browser. Currently, I can create a meeting in a headless browser, but I can't join the created meeting from another browser. When I tried so, another new conference with the same name is created and I'm the only participant in it. Can someone provide me with helpful advice on this problem? You can view the index.html and

get img src on google images with puppeteer

佐手、 提交于 2021-01-28 07:03:18
问题 Im doing a small script, and i want it to get a src from the first image on google photos, i have tried so many things, but i havent been able to get the src and save it into a variable. This is the script so far, i will be very grateful if you help me. const puppeteer = require('puppeteer'); let imgSrc (async () => { const browser = await puppeteer.launch({ headless: false, }); const page = await browser.newPage(); await page.setViewport({ width:1920, height:1080, isMobile: false }) await

Unable to login with Puppeteer

半腔热情 提交于 2021-01-28 05:59:11
问题 I am trying to login to Moz at https://moz.com/login with Puppeteer using the following code: const puppeteer = require('puppeteer'); const creds = { email: "myemail", password: "mypassword" }; (async () => { const browser = await puppeteer.launch({ args: [ '--disable-web-security', ], headless: false }); const page = await browser.newPage(); await page.goto("https://moz.com/login"); await page.$eval("input[name=email]", (el, value) => el.value = value, creds.email); await page.$eval("input