I'm trying to automate getting some pdf statements each month. I've
managed to log in and open the relevant page, which has three rows in
a table containing "PDF" and "HTML" options for viewing the
statements. When I manually click on "PDF", the appropriate PDF
statement opens in a new tab. But when I use "Click HTML link"
actions, the new tab opens but contains a copy of the original tab's
contents. Not useful.
I've tried using mouse events, but those don't work either.
How can I simulate clicking on the PDF html link so it acts like it
does when I do it manually? What could be screwing this up?
Here's the relevant section of the page source, just showing the first
of the 3 rows of statements:
<tr>
<th scope="col" class="th-border col1">Date</th>
<th scope="col" class="th-border col2">Statement</th>
<th scope="col" class="th-border align-center">View Statement<a
href="javascript:popupHelp('
http://personal.fidelity.com/webxpress/
help/topics/learn_portfolio_statements.shtml#differentways',
620,380);">
<img alt="Help" border="0" src="
https://scs.fidelity.com/accounts/
mailings/images/11_11_question1.gif"/></a>
</th>
<th scope="col" class="th-border align-center">Viewed</th>
<th scope="col" class="th-border align-center col5">My Notes</th>
<th scope="col" class="th-border align-center col3">Legal Info</th>
<th scope="col" class="th-border no-rt-border align-center
col1">Download</th>
</tr>
<tr class="alternate-row-color" id="cpopup0">
<th scope="row">
<abbr title="04/30/2012">04/30/2012</abbr>
</th>
<td>
Consolidated</td>
<td class="align-center">
<a
href="#cs8794ad18e339d484b21d4d3e9a81a6a1fc7a00805189f4e6af17143cdcb37dcf"
onclick='doTagging("Statements
PDF");getStatement("Y","8794ad18e339d484b21d4d3e9a81a6a1fc7a00805189f4e6af17143cdcb37dcf","04/30/2012");'
title="Print (PDF) format for your April 30, 2012 consolidated
statement. Opens in a new window.">PDF<span class="ofOffScreen">
format for your April 30, 2012 consolidated statement. Opens in a new
window.</span></a>
<span>|</span>
<a
href="#cx8794ad18e339d484b21d4d3e9a81a6a1fc7a00805189f4e6af17143cdcb37dcf"
onclick='doTagging("Statements
HTML");getXmlStatement("8794ad18e339d484b21d4d3e9a81a6a1fc7a00805189f4e6af17143cdcb37dcf",
"04/01/2012", "true", "04/30/2012","n");' title="View your April 30,
2012 consolidated statement in HTML screen format.">HTML<span
class="ofOffScreen"> format for your April 30, 2012 consolidated
statement.</span></a>
</td>
<td class="align-center">
Yes</td>
<td class="align-center">
<a
href="#cv8794ad18e339d484b21d4d3e9a81a6a1fc7a00805189f4e6af17143cdcb37dcf"
title="Add or Edit notes for your April 30, 2012 consolidated
statement. Opens in a new window."
onclick='setValues("04/30/2012","8794ad18e339d484b21d4d3e9a81a6a1fc7a00805189f4e6af17143cdcb37dcf","true","");showhidepops("notes","cpopup0","close1");doTagging("Statements
Notes");'>
Add<span class="ofOffScreen">Add or Edit notes for your April 30, 2012
consolidated statement. Opens in a new window.</span></a>
</td>
<td class="align-center">
<a href
="#l8794ad18e339d484b21d4d3e9a81a6a1fc7a00805189f4e6af17143cdcb37dcf"
onclick='popWindow("
https://scs.fidelity.com/accounts/mailings/content/
042012retbacker.html")' title="Legal information about your April 30,
2012 consolidated statement. Opens in a new window.">Legal Info<span
class="ofOffScreen">Legal Info</span></a>
</td>
<td class="no-rt-border align-center">
<a href="/ftgw/fbc/ofstatements/getStatementCsv?
k=8794ad18e339d484b21d4d3e9a81a6a1fc7a00805189f4e6af17143cdcb37dcf&c=04/01/2012&a=true&r=04/30/2012&download=y");'
title="CSV format of your April 30, 2012 consolidated statement. Opens
in a new window." onclick="doTagging('Statements CSV');">CSV<span
class="ofOffScreen">CSV format of your April 30, 2012 consolidated
statement. Opens in a new window.</span></a>
</td>
</tr>