I'm trying to programmatically extract some data from this url:
http://www.treasurydirect.gov/NP/BPDLogin?application=np
The issue is that it does a meta refresh back on to itself, and I'm trying to figure out what it is passing to the second request to get it to display the final page (rather than conitnually refreshing on to itself).
In order to help with the analysis, I've put the first page that peforms the refresh here: http://www.testpikefin.com/datadev/tdirect.html
There are a couple of javascript errors that can be ignored. The refresh happens after 8 seconds.
Update: Apparently I'm not phrasing the question well. Let me try another way.
When you go to this link:
http://www.treasurydirect.gov/NP/BPDLogin?application=np
The first html page that gets downloaded is this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="\\Ntdev57\wdb_dev_web\wdbdev3\Templates\govt.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="page_title" -->
<meta http-equiv="refresh" content="8; URL=http://www.treasurydirect.gov/NP/BPDLogin?application=np">
<!-- InstanceEndEditable -->
<title>Government - Debt to the Penny (Daily History Search Application)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link type="text/css" rel="stylesheet" media="screen" href="/css/global_null.css" />
<link type="text/css" rel="stylesheet" media="screen" href="/css/govt_screen.css" />
<link type="text/css" rel="stylesheet" media="print" href="/css/govt_print.css" />
<link type="text/css" rel="stylesheet" media="all" href="/css/global_fontsize76.css" title="76" />
<link type="text/css" rel="alternate stylesheet" media="all" href="/css/global_fontsize66.css" title="66" />
<link type="text/css" rel="alternate stylesheet" media="all" href="/css/global_fontsize86.css" title="86" />
<link type="text/css" rel="alternate stylesheet" media="all" href="/css/global_fontsize96.css" title="96" />
<script type="text/javascript" src="/js/textresize.js"></script>
<script type="text/javascript" src="/js/triggerParams.js"></script>
<script type="text/javascript" src="/js/stdLauncher.js"></script>
<script type="text/javascript"> Poll();</script>
</head>
<body id="instit">
<div id="container">
<!-- BEGIN HEADER -->
<div id="header">
<!-- BEGIN LOGO -->
<div id="logo">
<a href="/tdhome.htm"><img src="/images/td_logo.gif" width="232" height="50" alt="TreasuryDirect Logo" /></a>
</div>
<!-- END LOGO -->
<!-- BEGIN TYPE NAVIGATION -->
<div id="typenav">
<ul id="investortype">
<li>You are in:</li>
<li><a href="/indiv/indiv.htm">Individual</a></li>
<li> | </li>
<li><a href="/RT/RTGateway?page=institHome">Institutional</a></li>
<li> | </li>
<li><strong>> Government</strong></li>
</ul>
</div>
<!-- END TYPE NAVIGATION -->
<!-- BEGIN SEARCH BOX -->
<div id="searchbox">
<!-- <form id="gs" method="get" action="http://search.treas.gov/search">
<fieldset>
<label for="q">Search: </label>
<input type="text" name="q" id="q" size="25" maxlength="256" value="" />
<input name="btnG" value="Search" class="button" type="image" src="/images/go.gif" alt="Go" />
<input type="hidden" name="sort" value="date:D:L:d1" />
<input type="hidden" name="output" value="xml_no_dtd" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="hidden" name="oe" value="UTF-8" />
<input type="hidden" name="client" value="BPD-treasurydirect" />
<input type="hidden" name="proxystylesheet" value="BPD-treasurydirect" />
<input type="hidden" name="site" value="BPD-treasurydirect" />
</fieldset>
</form> -->
</div>
<!-- END SEARCH BOX -->
<!-- BEGIN UTILITY NAVIGATION -->
<div id="utilitynav">
<ul>
<li><a href="/maillist/maillist.htm">Mailing Lists</a></li>
<li> | </li>
<li><a href="/news/news.htm">News</a></li>
<li> | </li>
<li><a href="/about.htm">About</a></li>
<li> | </li>
<li><a href="/sitemap.htm">Sitemap</a></li>
<li> | </li>
<li><a href="/email.htm">Contact Us</a></li>
</ul>
</div>
<!-- END UTILITY NAVIGATION -->
</div>
<!-- END HEADER -->
<!-- BEGIN PERSISTENT NAVIGATION -->
<div id="persistentnav">
<ul>
<li class="doubleline"><a class="nonactive" href="/govt/apps/apps.htm">Applications & Programs</a></li>
<li class="singleline"><a class="active" href="/govt/reports/reports.htm">Reports</a></li>
<li class="singleline"><a class="nonactive" href="/govt/rates/rates.htm">Interest Rate Data</a></li>
<li class="singleline"><a class="nonactive" href="/govt/charts/charts.htm">Charts & Analysis</a></li>
<li class="singleline"><a class="nonactive" href="/govt/resources/resources.htm">Resources</a></li>
</ul>
</div>
<!-- END PERSISTENT NAVIGATION -->
<div id="contentwrap">
<!-- BEGIN BREADCRUMBNAV -->
<div id="breadcrumbnav">
<ul id="breadcrumb">
<li><a href="http://www.treasurydirect.gov">Home</a></li>
<li>›</li>
<li><a href="/govt/govt.htm">Government</a></li>
<li>›</li>
<li><a href="/govt/reports/reports.htm">Reports</a></li>
<li>›</li>
<li><a href="/govt/reports/pd/pd.htm">Public Debt Reports</a></li>
<li>›</li>
<li>Debt to the Penny (Daily History Search Application)</li>
</ul>
</div>
<!-- END BREADCRUMBNAV -->
<!-- BEGIN LOCALNAV -->
<div id="localnav">
<h1>REPORTS</h1>
<div id="verticalline">
<ul>
<li class="closed"><a href="/govt/reports/fip/fip.htm">Federal Investments Program</a></li>
<li class="openlast"><a href="/govt/reports/pd/pd.htm" class="active">Public Debt Reports</a>
<div class="subindent"><a href="/govt/reports/pd/pd_accountrpt.htm">Accountability Report</a></div>
<div class="subindent"><a href="/govt/reports/pd/pd_bearregsec.pdf">Bearer and Registered Securities (PDF)</a></div>
<div class="subindent"><a href="/govt/reports/pd/pd_debtposactrpt.htm">Debt Position and Activity Report</a></div>
<div class="subindent"><a href="/NP/BPDLogin?application=np" class="active">Debt to the Penny (Daily History / Search)</a></div>
<div class="subindent"><a href="/govt/reports/pd/feddebt/feddebt.htm">Schedules of Federal Debt</a></div>
<div class="subindent"><a href="/govt/reports/pd/pd_tror.pdf">TROR (PDF)</a></div>
</li>
</ul>
</div>
<!-- BEGIN ACCOUNT CENTER -->
<div id="login">
<h2>ACCOUNT CENTER</h2>
<h3>Log in now</h3>
<ul>
<li><a href="/GA-SZ/BPDLogin?application=GA-SZ">SLGSafe<sup>®</sup></a></li>
<li><a href="/FD/FedInvestGateway">FedInvest<sup>®</sup></a></li>
</ul>
<ul id="openacct">
<li><a href="/govt/govt_acctsetup.htm">Set up an account</a></li>
</ul>
</div>
<!-- END ACCOUNT CENTER -->
<noscript>
<div id="acsialert"><p><img src="/images/alertmessage.gif" width="16" height="16" alt="Exclamation Point" />We're pleased to hear from our customers regarding their satisfaction with our website. Although your browser settings don't allow you to view the website survey we're conducting, please <a href="mailto:oadmin@bpd.treas.gov">e-mail</a> your comments.</p></div>
</noscript>
</div>
<!-- END LOCALNAV -->
<!-- BEGIN CONTENT -->
<div id="content">
<h1>Debt to the Penny (Daily History Search Application)</h1>
<!-- InstanceBeginEditable name="content" -->
<p>You can't bookmark a Debt to the Penny daily history search. However, you can bookmark the Debt to the Penny page, at <a href="/NP/BPDLogin?application=np">http://www.treasurydirect.gov/NP/BPDLogin?application=np</a></p>
<p>For your convenience, this page will redirect to this URL in 8 seconds or less.</p>
<!-- InstanceEndEditable --> </div>
<!-- END CONTENT -->
<!-- BEGIN SUBLOCALNAV -->
<div id="right">
<!-- BEGIN TEXT SIZE -->
<div id="textsize">
<script type="text/javascript">
<!--
//alert("here 2");
var size = GetTextSize();
document.write("<p>");
if (size == 66) {
document.write(" Text Size ");
document.write("<a href=\"#\" onclick=\"IncreaseTextSize(size);\">[+]<\/a>");
}
else if (size == 86) {
document.write("<a href=\"#\" onclick=\"DecreaseTextSize(size);\">[–]<\/a>");
document.write(" Text Size ");
document.write("<a href=\"#\" onclick=\"IncreaseTextSize(size);\">[+]<\/a>");
}
else if (size == 96) {
document.write("<a href=\"#\" onclick=\"DecreaseTextSize(size);\">[–]<\/a>");
document.write(" Text Size ");
}
else {
document.write("<a href=\"#\" onclick=\"DecreaseTextSize(size);\">[–]<\/a>");
document.write(" Text Size ");
document.write("<a href=\"#\" onclick=\"IncreaseTextSize(size);\">[+]<\/a>");
}
document.write("<\/p>");
-->
</script>
<noscript>
<p> </p>
</noscript>
</div>
<!-- END TEXT SIZE -->
<img src="/images/govt/relatedlinks.gif" width="170" height="20" alt="Related Links" />
<ul class="relatedlinks">
<li><a href="/govt/rates/pd/avg/avg.htm">Average Interest Rates</a></li>
<li><a href="/govt/charts/principal/principal.htm">Principal/Interest Graphs</a></li>
<li><a href="/govt/resources/faq/faq_publicdebt.htm">FAQ</a></li>
</ul>
</div>
<!-- END SUBLOCALNAV -->
</div>
<!-- BEGIN FOOTER -->
<div id="footer">
<ul>
<li><a href="/foia.htm">Freedom of Information Act</a></li>
<li>|</li>
<li><a href="/law_and_guidance.htm">Law开发者_如何学C & Guidance</a></li>
<li>|</li>
<li><a href="/privacy.htm">Privacy & Legal Notices</a></li>
<li>|</li>
<li><a href="/terms.htm">Website Terms & Conditions</a></li>
<li>|</li>
<li><a href="/accessibility.htm">Accessibility</a></li>
<li>|</li>
<li><a href="/data_quality.htm">Data Quality</a></li>
</ul>
<p><a href="http://www.publicdebt.treas.gov/">U.S. Department of the Treasury, Bureau of the Public Debt</a></p>
<p><em>Last Updated May 31, 2007</em></p>
</div>
<!-- END FOOTER -->
</div>
</body>
<!-- InstanceEnd --></html>
The page then refreshes back onto itself and generates this (different) html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>
<title>Debt to the Penny (Daily History Search Application)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><link type="text/css" rel="stylesheet" media="screen" href="/css/gw_td_null.css" /><style type="text/css" media="screen">@import "/css/gw_govt_screen.css"; </style><style type="text/css" media="print">@import "/css/gw_govt_print.css"; </style><link type="text/css" rel="stylesheet" media="all" href="/css/gw_td_fontsize76.css" title="76" /><link rel="alternate" type="application/rss+xml" title="Treasury Offering Announcements" href="/RI/TreasuryOfferingAnnouncements.rss"/><link rel="alternate" type="application/rss+xml" title="Treasury Auction Results" href="/RI/TreasuryAuctionResults.rss"/><link rel="alternate" type="application/rss+xml" title="Monthly Statement of the Public Debt" href="/rss/mspd.xml"/><link rel="alternate" type="application/rss+xml" title="Savings Bonds Pro Updates" href="/rss/sbpro.xml"/><link rel="alternate" type="application/rss+xml" title="Savings Bonds Wizard Updates" href="/rss/wizard.xml"/>
</head>
<body>
<div id="container"><!-- BEGIN HEADER --><div id="header"><!-- BEGIN LOGO --><div id="logo"><a href="/tdhome.htm"><img src="/images/gw/td_logo.gif" width="232" height="50" alt="TreasuryDirect Logo" /></a></div><!-- END LOGO --><!-- BEGIN TYPE NAVIGATION --><div id="typenav"><ul id="investortype"><li>You are in:</li><li><a href="/indiv/indiv.htm">Individual</a></li><li> | </li><li><a href="/RT/RTGateway?page=institHome">Institutional</a></li><li> | </li><li><strong>> Government</strong></li></ul></div><!-- END TYPE NAVIGATION --><!-- BEGIN SEARCH BOX --><div id="searchbox"><form id="gs" method="get" action="http://search.treas.gov/search"><fieldset><label for="q">Search: </label><input type="text" name="q" id="q" size="25" maxlength="256" value="" /><input name="btnG" value="Search" class="button" type="image" src="/images/gw/go.gif" alt="Go" /><input type="hidden" name="sort" value="date:D:L:d1" /><input type="hidden" name="output" value="xml_no_dtd" /><input type="hidden" name="ie" value="UTF-8" /><input type="hidden" name="oe" value="UTF-8" /><input type="hidden" name="client" value="BPD-treasurydirect" /><input type="hidden" name="proxystylesheet" value="BPD-treasurydirect" /><input type="hidden" name="site" value="BPD-treasurydirect" /></fieldset></form></div><!-- END SEARCH BOX --><!-- BEGIN UTILITY NAVIGATION --><div id="utilitynav"><ul><li><a href="/maillist/maillist.htm">Mailing Lists</a></li><li> | </li><li><a href="/news/news.htm">News</a></li><li> | </li><li><a href="/about.htm">About</a></li><li> | </li><li><a href="/sitemap.htm">Sitemap</a></li><li> | </li><li><a href="/email.htm">Contact Us</a></li></ul></div><!-- END UTILITY NAVIGATION --></div><!-- END HEADER -->
<!-- BEGIN PERSISTENT NAVIGATION --><div id="persistentnav"><ul><li class="doubleline"><a class="nonactive" href="/govt/apps/apps.htm">Applications & Programs</a></li><li class="singleline"><a class="active" href="/govt/reports/reports.htm">Reports</a></li><li class="doubleline"><a class="nonactive" href="/govt/rates/rates.htm">Interest Rates<br />& Prices</a></li><li class="singleline"><a class="nonactive" href="/govt/charts/charts.htm">Charts & Analysis</a></li><li class="singleline"><a class="nonactive" href="/govt/resources/resources.htm">Resources</a></li></ul></div><!-- END PERSISTENT NAVIGATION --><div id="contentwrap">
<!-- BEGIN BREADCRUMBNAV --><div id="breadcrumbnav"><ul id="breadcrumb"><li><a href="http://www.treasurydirect.gov">Home</a></li><li>›</li><li><a href="/govt/govt.htm">Government</a></li><li>›</li><li><a href="/govt/reports/reports.htm">Reports</a></li><li>›</li><li><a href="/govt/reports/pd/pd.htm">Public Debt Reports</a></li><li>›</li><li>Debt to the Penny</li></ul></div><!-- END BREADCRUMBNAV -->
<!-- BEGIN LOCALNAV --><div id="localnav"><h1>REPORTS</h1><div id="verticalline"><ul><li class="closed"><a href="/govt/reports/fip/fip.htm">Federal Investments Program</a></li><li class="closed"><a href="/govt/reports/slgs/slgs.htm">SLGS</a></li><li class="closed"><a href="/govt/reports/tfmp/tfmp.htm">Trust Funds Program</a></li><li class="closed"><a href="/govt/reports/tbp/tbp.htm">Treasury's Borrowings Program</a></li><li class="closed"><a href="/govt/reports/ir/ir.htm">Interest Reports</a></li><li class="openlast"><a href="/govt/reports/pd/pd.htm" class="active">Public Debt</a><div class="subindent"><a href="/govt/reports/pd/pd_accountrpt.htm">Accountability Report</a></div><div class="subindent"><a href="/govt/reports/pd/pd_bearregsec.pdf">Bearer and Registered Securities</a></div><div class="subindent"><a href="/govt/reports/pd/pd_debtposactrpt.htm">Debt Position and Activity Report</a></div><div class="subindent2"><a href="/NP/BPDLogin?application=np" class="active">Debt to the Penny (Daily History / Search)</a></div><div class="subindent"><a href="/exit.htm?http://fms.treas.gov/dts/index.html">DTS</a></div><div class="subindent"><a href="/govt/reports/pd/mspd/mspd.htm">MSPD</a></div><div class="subindent"><a href="/govt/reports/pd/gift/gift.htm">Gifts</a></div><div class="subindent"><a href="/govt/reports/pd/histdebt/histdebt.htm">Historical Debt Outstanding</a></div><div class="subindent"><a href="/govt/reports/pd/pd_pdotables_downloadable_files.htm">PDO</a></div><div class="subindent"><a href="/govt/reports/pd/pd_sbntables_downloadable_files.htm">SBN</a></div><div class="subindent"><a href="/govt/reports/pd/feddebt/feddebt.htm">Schedules of Federal Debt</a></div><div class="subindent"><a href="/govt/reports/pd/pd_tror.htm">TROR</a></div></li></ul></div><!-- BEGIN ACCOUNT CENTER --><div id="login"><h2>ACCOUNT CENTER</h2><h3>Log in now</h3><ul><li><a href="/SZ/BPDLogin?application=spss">SLGSafe<sup>®</sup></a></li><li><a href="/FD/FedInvestGateway.htm">FedInvest<sup>®</sup></a></li></ul><ul id="openacct"><li><a href="/govt/govt_acctsetup.htm">Set up an account</a></li></ul></div><!-- END ACCOUNT CENTER --></div><!-- END LOCALNAV -->
<!-- BEGIN CONTENT -->
<div id="content">
<form method="post" action="NPGateway">
<!--<%errormsg%>-->
<h1>The Debt to the Penny and Who Holds It</h1>
<p class="subhead">( <a href="/govt/resources/faq/faq_publicdebt.htm#DebtOwner">Debt Held by the Public</a> vs. <a href="/govt/resources/faq/faq_publicdebt.htm#DebtOwner">Intragovernmental Holdings</a> )</p>
<table class="data1">
<tr>
<th>Current</th>
<th>Debt Held by the Public</th>
<th>Intragovernmental Holdings</th>
<th>Total Public Debt Outstanding</th>
</tr>
<tr><td>05/09/2011</td><td align="right">9,681,179,453,898.66</td><td align="right">4,644,605,091,889.65</td><td align="right">14,325,784,545,788.31</td></tr>
</table>
<p>See information on the <a href="/govt/govt.htm">Debt Subject to the Limit</a>.</p>
<h2>Daily History Search Application</h2>
<p>To find the total public debt outstanding on a specific day or days, simply select a single date or date range and click on the 'Find History' button.</p>
<p>The data on total public debt outstanding is available daily from 01/04/1993 through 05/09/2011. The debt held by the public versus intragovernmental holdings data is available:</p>
<ul>
<li>Yearly (on a fiscal basis) from 09/30/1997 through 05/09/2011. </li>
<li>Monthly from 09/30/01 through 03/31/05</li>
<li>Daily from 03/31/05 through 05/09/2011</li>
</ul>
<br />
<fieldset>
<div class="columnwrap3">
<div class="column">
<table class="data3">
<tr>
<th colspan="3">Enter Beginning Date</th>
</tr>
<tr>
<th class="cat"><label for="begMonth">Month</label></th>
<th class="cat"><label for="begDay">Day</label></th>
<th class="cat"><label for="begYear">Year</label></th>
</tr>
<tr>
<td>
<select name="begMonth">
<option></option>
<option value="01">January</option>
<option value="02">February</option>
<option value="03">March</option>
<option value="04">April</option>
<option value="05">May</option>
<option value="06">June</option>
<option value="07">July</option>
<option value="08">August</option>
<option value="09">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select></td>
<td><select name="begDay">
<option></option>
<option value="01">1</option>
<option value="02">2</option>
<option value="03">3</option>
<option value="04">4</option>
<option value="05">5</option>
<option value="06">6</option>
<option value="07">7</option>
<option value="08">8</option>
<option value="09">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select></td>
<td><select name="begYear">
<option></option>
<option value="1993">1993</option>
<option value="1994">1994</option>
<option value="1995">1995</option>
<option value="1996">1996</option>
<option value="1997">1997</option>
<option value="1998">1998</option>
<option value="1999">1999</option>
<option value="2000">2000</option>
<option value="2001">2001</option>
<option value="2002">2002</option>
<option value="2003">2003</option>
<option value="2004">2004</option>
<option value="2005">2005</option>
<option value="2006">2006</option>
<option value="2007">2007</option>
<option value="2008">2008</option>
<option value="2009">2009</option>
<option value="2010">2010</option>
<option value="2011">2011</option>
</select></td>
</tr>
</table>
</div>
<div class="column">
<table class="data3">
<tr>
<th colspan="3">Enter Ending Date (optional)</th>
</tr>
<tr>
<th class="cat"><label for="endMonth">Month</label></th>
<th class="cat"><label for="endDay">Day</label></th>
<th class="cat"><label for="endYear">Year</label></th>
</tr>
<tr>
<td><select name="endMonth">
<option></option>
<option value="01">January</option>
<option value="02">February</option>
<option value="03">March</option>
<option value="04">April</option>
<option value="05">May</option>
<option value="06">June</option>
<option value="07">July</option>
<option value="08">August</option>
<option value="09">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select></td>
<td><select name="endDay">
<option></option>
<option value="01">1</option>
<option value="02">2</option>
<option value="03">3</option>
<option value="04">4</option>
<option value="05">5</option>
<option value="06">6</option>
<option value="07">7</option>
<option value="08">8</option>
<option value="09">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select></td>
<td><select name="endYear">
<option></option>
<option value="1993">1993</option>
<option value="1994">1994</option>
<option value="1995">1995</option>
<option value="1996">1996</option>
<option value="1997">1997</option>
<option value="1998">1998</option>
<option value="1999">1999</option>
<option value="2000">2000</option>
<option value="2001">2001</option>
<option value="2002">2002</option>
<option value="2003">2003</option>
<option value="2004">2004</option>
<option value="2005">2005</option>
<option value="2006">2006</option>
<option value="2007">2007</option>
<option value="2008">2008</option>
<option value="2009">2009</option>
<option value="2010">2010</option>
<option value="2011">2011</option>
</select></td>
</tr>
</table>
</div>
</div>
<div class="buttons"><input type="submit" name="SubmitDebtToPennySearchPage.x" value="Find History" class="action" /></div>
<!-- HIDDEN VALUES -->
<input type="hidden" name="processID" value="1305140395222" />
<input type="hidden" name="primary" value="false" />
<input type="hidden" name="transform" value="true" />
<input type="hidden" name="transformType" value="ImageButton" />
<!-- HIDDEN VALUES -->
</fieldset>
</form>
</div>
<!-- END CONTENT -->
<!-- BEGIN SUBLOCALNAV --><div id="right"><img src="/images/gw/relatedlinks.gif" width="170" height="20" alt="Related Links" /><ul class="relatedlinks"><li><a href="/govt/rates/pd/avg/avg.htm">Average Interest Rates</a></li><li><a href="/govt/charts/principal/principal.htm">Principal/Interest Graphs</a></li><li><a href="/govt/resources/faq/faq_publicdebt.htm">FAQ</a></li></ul></div><!-- END SUBLOCALNAV -->
</div>
<!-- BEGIN FOOTER --><div id="footer"><ul><li><a href="/foia.htm">Freedom of Information Act</a></li><li>|</li><li><a href="/law_and_guidance.htm">Law & Guidance</a></li><li>|</li><li><a href="/privacy.htm">Privacy & Legal Notices</a></li><li>|</li><li><a href="/terms.htm">Website Terms & Conditions</a>/li><li>|</li><li><a href="/accessibility.htm">Accessibility</a></li><li>|</li><li><a href="/data_quality.htm">Data Quality</a></li></ul><p><a href="http://www.publicdebt.treas.gov/">U.S. Department of the Treasury, Bureau of the Public Debt</a></p></div><!-- END FOOTER --></div></body></html>
The first HTTP response sets a cookie with a session id. The refresh probably acts on that cookie, knowing that it's now set.
If you're writing a script to scrape the site you should be able to store and send any cookies that get set. I know that PHP / cURL can do it.
view the page source, it's right there:
<meta http-equiv="refresh" content="8; URL=http://www.treasurydirect.gov/NP/BPDLogin?application=np">
精彩评论