-
Notifications
You must be signed in to change notification settings - Fork 275
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
Wait until javascript is executed #13
Comments
This problem occurs with asynchronous javascripts. |
@gsouf Is there any way right now to force the browser to wait until JavaScript is executed before marking |
Hi @orditeck Do you mean, when the javascript initially executes when page has loaded? |
Basically I'd like the browser to wait for async call before marking |
@orditeck there are some confusions that I need to clarify before I give you the right answer.
Can you, please, give me a sample of the code that you are running to make sure I'll answer it corretcly? |
|
@orditeck I think there are 2 options. The more accurate is that you are able to identify a state where your operation has completed. For instance the loader is not in the dom anymore. Unfortunately there are no shortcut to do that in the library yet, but it can be added. The second option is to wait for the page event $page
->navigate('http://page_with_react_asyn_fecth_data')
->waitForNavigation('networkIdle', 10000); Can you let me know if it solves? |
@gsouf I agree that being able to tell the |
The Example:
Am not too proud of this, but its a solution Note: I put the server request to the page myself becouse the page I am accessing is mine. But as its possible to add a script before If I missed an obvious solution to this problem, please ping me about it :). |
This issue has been automatically marked as stale because there has been no recent activity. It will be closed after 30 days if no further activity occurs. Thank you for your contributions. |
$page->navigate('some - url')->waitForNavigation();
$content = $page->evaluate('document.documentElement.innerHTML')->getReturnValue();
Not all javascript is executed when doing the getReturnValue.
Is there a way to wait until it's done?
The text was updated successfully, but these errors were encountered: