I want to get the number of total pages of a given search resluts of this site: http://srh.bankofchina.com/search/whpj/searchen.jsp, e.g., from 2015-1-12 to 2015-1-13 the currency of USD by the following code:
$initialUrl = "http://srh.bankofchina.com/search/whpj/searchen.jsp";
startdate = "2015-01-12";
enddate = DateString[{"Year", "-", "Month", "-", "Day"}];
name = "1336"; (*only USD*)
$parameters = {"erectDate" -> startdate, "nothing" -> enddate,
"pjname" -> name};
$results = Import[$initialUrl, "Data"
, "RequestMethod" -> "POST"
, "RequestParameters" -> $parameters]
$results // ColumnForm;
But it seems that the Data did not include the total number of pages (as in the following graph).

So is there still a way to get the total number of pages, such that I can get all the results page by page?
newandlastis defined before the loop even starts. If, before the loop even starts,new == lastthen there is only one page. SoIf[new == last, new, While...]. – C. E. Jan 13 '15 at 13:30Mostis needed because it retrieves one duplicate before it realizes that it is a duplicate. Please, I don't think you should accept this. Not yet at least. It didn't find the number by parsing the HTML as you requested. It was just a solution I happened upon, and thought I should post. – C. E. Jan 13 '15 at 14:00