You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It doesnt work, $elem2 evaluates to null.
I think because the first click $e->click(); changes the DOM. Hello there! is always absent since it can be seen only sometimes after the click $e->click();.
And the $elem2 is always null because the '.messenger-ovl__close.im-close' appears always but only after the first click. So it is not present in the beginning in the DOM. its a close button that appears after first click of any card.
three questions.
1.So the first click changes the DOM. How to update it/reload it/...? So I can find the '.messenger-ovl__close.im-close' and click it after the first click that wasnt present before the first click?
2.Am I doing some waiting right? With sleep(1);? I want the browser and the code to wait at least 1-2s after the clicking, if its too fast it doesnt work. Or is there better/proper way?
3.How to get the actual html after the first click? Cuz sometimes Hello there! is present but only after the first click $e->click(); and it seems like $content = $page->evaluate( 'document.documentElement.innerHTML' )->getReturnValue(); returns the innerHTML before the first click happens.
The text was updated successfully, but these errors were encountered:
If you call Page::dom() again, the previous node ids will become stale. See my last reply in #469. I'll leave this one closed since it's the same issue. Normally I would close the newer issue as a duplicate, but in this case it has more replies and more useful info.
For waiting, you can use Utils::tryWithTimeout() to perform any check every N microseconds. The Page::waitUntilContainsElement() uses this to wait until a desired element appear in the page.
Having something like that
It doesnt work, $elem2 evaluates to null.
I think because the first click
$e->click();
changes the DOM. Hello there! is always absent since it can be seen only sometimes after the click$e->click();
.And the
$elem2
is always null because the'.messenger-ovl__close.im-close'
appears always but only after the first click. So it is not present in the beginning in the DOM. its a close button that appears after first click of any card.three questions.
1.So the first click changes the DOM. How to update it/reload it/...? So I can find the
'.messenger-ovl__close.im-close'
and click it after the first click that wasnt present before the first click?2.Am I doing some waiting right? With
sleep(1);
? I want the browser and the code to wait at least 1-2s after the clicking, if its too fast it doesnt work. Or is there better/proper way?3.How to get the actual html after the first click? Cuz sometimes
Hello there!
is present but only after the first click$e->click();
and it seems like$content = $page->evaluate( 'document.documentElement.innerHTML' )->getReturnValue();
returns the innerHTML before the first click happens.The text was updated successfully, but these errors were encountered: