title: How to simulate onclick (JavaScript) using Selenium/Python
body: <p>I am using Python/Selenium to click on an icon on a web site which downloads a file. I know how to click on regular buttons using Selenium but this one is a bit tricky as it's not a regular button and it's making a Javascript call. I've tried several find_element_by calls but was unable to access this element. Can anyone think of a way to click on this using a selenium call? </p>
  
  <p>When I do inspect element for the download icon in my web browser this is what I get:</p>
  
  <pre><code>&lt;a href="javascript: void(0)" class="pull-right margin-r" onclick="
                          document.theForm.action='/p1234/DownloadData';
                          $('#theForm').append($('&lt;input&gt;', {type:'hidden', name:'Download', value:'Download'})).submit();
                      "&gt;&lt;img src="/images/download.png" title="Download" alt="Download" style="" border="0"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>thanks in advance</p>