-
Notifications
You must be signed in to change notification settings - Fork 9.2k
page.scroll()? #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
So if you query an element and call hover on that it will scroll into view if needed. So IMO there should also be an API to simply scroll an element into view without triggering any other side effects. |
you can also page.evaluate(_ => {
window.scrollBy(0, window.innerHeight);
}); |
@Garbee but right now I can't figure out how to iterate over all the images. see #303. |
We use scrollIntoViewIfNeeded. I think that this will solve your issue once we have |
@JoelEinbinder can you elaborate what you mean by page.$$ is that integration of jquery? |
We do nothing with jQuery internally. That is a page-level library. |
works better for me. |
you can use it
|
I solved this, editing the onReady.js file located at /engine_scripts/puppet/ The final .js file looks like this: module.exports = async (page, scenario, vp)=>{ await page.goto(scenario.url, {waitUntil: 'load'}); // Scroll one viewport at a time, pausing to let content load // Scroll back to top // Some extra delay to let images load I found this solution at https://www.screenshotbin.com/blog/handling-lazy-loaded-webpages-puppeteer . |
@visualxcode ,you got my code from here? chenxiaochun/blog#38 |
|
Worked for me:
|
Hello there,
In order to test image preloading, it is essential to be able to scroll the viewport somehow. Any plans for that?
The text was updated successfully, but these errors were encountered: