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
page.waitForSelector doesn't work on baidu.com #609
Comments
As reported in #1668, |
Suggest renaming this issue to something more general, like: "Puppeteer methods break if pages redefine built-in global objects" Is this sort of thing even possible to work around at the library level? I did this in my code, which seems to work ok: await this.page.evaluate( () => {
if ( ! window.Node ) {
window.Node = {};
}
if ( ! Node.ELEMENT_NODE ) {
Node.ELEMENT_NODE = 1;
}
} ); |
Any updates on this issue? |
This was referenced Sep 4, 2018
aslushnikov
added a commit
to aslushnikov/puppeteer
that referenced
this issue
Jan 28, 2019
This patch starts executing frame.waitForSelector and frame.waitForXPath in secondary world. As a result, websites that mutate page global context (e.g. removing global MutationObserver) don't break Puppeteer's behavior. Fixes puppeteer#609
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following script fails with baidu.com:
The reason is that Baidu nullifies MutationObserver that is required for
waitForSelector
.The text was updated successfully, but these errors were encountered: