Comments (6)
Hello there, Can you upload some of your code? I might be able to see if your missing something... or you can try adding this with headless: false
mode:
browser.on('targetcreated', async target => { if (target.type() === 'page') { const page = await target.page() await page.target().createCDPSession() } })
from pageres.
This is my code. It worked until a few days
await new Pageres({delay: 3, script: `./web_scripts/google_translate/run.js`})
.source(translationUrl, ["1920x1080"], {filename: `${imageId}`, selector: `body > c-wiz:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(2) > c-wiz:nth-of-type(1) > div:nth-of-type(2) > c-wiz:nth-of-type(1) > div:nth-of-type(1)`})
.destination("./images/")
.run();
from pageres.
You could try waiting for the selector to appear. Like set a timeout before continuing
from pageres.
Do you mean delay?
from pageres.
So no, you already have a delay of 3 seconds there... what im saying is have puppeteer wait for the selector maybe something like
page.waitForSelector('body
> c-wiz:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(2) > c-wiz:nth-of-type(1) > div:nth-of-type(2) > c-wiz:nth-of-type(1) > div:nth-of-type(1)', {timeout: 10 * 1000})`
so instead of what your doing try something like this:
await new Pageres({
delay: 3,
beforeScreenshot: async (page, browser) => {
await checkSomething();
await page.waitForSelector('body > c-wiz:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(2) > c-wiz:nth-of-type(1) > div:nth-of-type(2) > c-wiz:nth-of-type(1) > div:nth-of-type(1)', {timeout: 10 * 1000})
await page.click('do something with that selector or any other selector'); // you might not need this.
}
})
.source(translationUrl, ["1920x1080"],{filename: ${imageId}})
.destination('./images/')
.run();
console.log('finished so and so');
from pageres.
Plottwist, google just did some stuff i didnt like so that was the actual reason, why that stuff didn't work. Thanks anyways
from pageres.
Related Issues (20)
- Retrieve "final" URL after redirects HOT 2
- Capture a livecam page HOT 1
- Default timeout is not working with pageres-cli when run with PowerShell HOT 1
- Installation problem with MacOS M1 chip HOT 5
- Update version of capture-website HOT 5
- Heroku CLI HOT 1
- Doesn't find chromium binary on aarch64 HOT 1
- Support beforeScreenshot option HOT 1
- Options beforeScreenshot doesn't work
- pageres stuck HOT 1
- My project works on windows server but not on my Ubuntu server. Error: Failed to launch the browser process! HOT 3
- Error: EPERM: operation not permitted, unlink errno: -4048 HOT 3
- Script not working HOT 3
- Support for vercel
- Package Update HOT 2
- Failed at the [email protected] postinstall script. HOT 1
- ERR_CERT_AUTHORITY_INVALID
- Crawl website? HOT 1
- Puppeteer old Headless deprecation warning HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pageres.