We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I tried the following code, but it did not seem to work:
$client->waitForVisibility('img');
The text was updated successfully, but these errors were encountered:
Hmmm, I'm not sure if it's cause my images have loading="lazy" attribute..
loading="lazy"
Sorry, something went wrong.
This seems to be a workaround:
$client->executeScript(" Promise.all(Array.from(document.images).filter(img => !img.complete).map(img => new Promise(resolve => { img.onload = img.onerror = resolve; }))).then(() => { console.log('All images loaded.'); var div = document.createElement('div'); div.setAttribute('id', 'imagesLoaded'); div.innerHTML = 'Images loaded'; document.body.appendChild(div); }); "); $client->waitForVisibility('div#imagesLoaded');
You can then continue to remove the appended div if needed.
No branches or pull requests
I tried the following code, but it did not seem to work:
The text was updated successfully, but these errors were encountered: