How to trigger an event using pyquery python
<p>I'm trying to automate a headless web browser using python and packages like pyquery, beautiful soup, requests, mechanize.</p>

<p>But so far I haven't found a right way to trigger a click event on a button. For example, to fill an online form, I'm able to insert values in the text fields, but not able to click on the Submit/Send button. </p>

<p>According to the <a href="https://pypi.python.org/pypi/pyquery" rel="nofollow">docs</a>, pyquery isn't a library to interact with JS code (at least not yet). It is used to parse HTML Docs like beautiful soup.</p>

<p>As Nehal suggested, <a href="http://selenium-python.readthedocs.io/" rel="nofollow">selenium</a> is your best bet.  </p>

python beautifulsoup mechanize pyquery