Python Forum
With SplashRequest to run javascript onclick function to render page properly - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: With SplashRequest to run javascript onclick function to render page properly (/thread-15862.html)



With SplashRequest to run javascript onclick function to render page properly - don - Feb-04-2019

Hello,
I need to call javascript function with my SplashRequest.
This javascript I need to execute before page is render
<a href="#" onclick="submitCreateReservation('ypsForm:j_id205','O-0-0-0');">option</a>

How should I code my SplashRequest?

yield SplashRequest(
    'http://example.com',
    endpoint='render.html',
    args={'js_source': 'document.title="My Title";'})