Clicking on javascript anchor with htmlunit does not fetch response
<p>So,</p>

<p>I collected all the anchors of a <code>Page</code> in a list of <code>HtmlAnchors</code>.</p>

<pre><code>List&lt;HtmlAnchor&gt; downloadLinks = (List) loggedIn.getByXPath("//*[@id='ctl00_ContentPlaceHolder1_rgdProduction_ctl00']//a"); 
</code></pre>

<p>And then, I went in a loop to click on each anchor in the list and tried to fetch their respective Web Responses.</p>

<pre><code>for (int i = 1; i &lt; downloadLinks.size(); i++) {

    Page p = (Page) downloadLinks.get(i).click();

    WebResponse wr = p.getWebResponse();

    System.out.println("Page Content: " + wr.getContentAsStream());

}
</code></pre>

<p>*NOTE: The anchors collected are of this format -> a href = "javascript:_some_methodname_()</p>

<p>The problem is that after clicking on each anchor in the list of Anchors, it fetches the same exact web response whereas it should have presented 'n' unique responses for 'n' anchors
Similar question has been asked by other users, but I haven't found any solution to this problem.</p>