c# - Input string error when posting for next set of data -


the other day had scraper working well, when realized wasn't getting enough records, decided search postal code , had change of code. first post , response goes off without hitch, when post next page of results fails on response.

the starting code is...

public void startscrape() {     list<string> = lstpostalcodes();     (int = 0; <= lstpostalcodes().count; i++)     {         b = a[i];         firstrequestresponse(b);          if (gobacktostartsearch == "continueon")             startnextrequest(getviewstate(responsedata));         else         {             writedatatofile(responsedata);             finalclean();         }     } } 

the method calling startnextrequest. in startnextrequest method is

private void getresults(httpwebrequest wr) {     using (streamreader responsereader = new streamreader(wr.getresponse().getresponsestream()))     {         // add response/results string         responsedata = responsereader.readtoend();     }     string strfind = "<li id='nextdisabled'>";      if (responsedata.contains(strfind)) gobacktostartsearch = "backtostart";     else         gobacktostartsearch = "continueon"; } 

the error throwing saying

input string not in correct format

and pointing @ using (streamreader...)

i have gotten other errors seem fix, creates error has waiting bytes written. i'm using fiddler2 give me more info on errors, headers pretty same, i'm not seeing of difference, other 1 being request , other response.

i have no idea on why saying that, have stepped through working code wrote scrape data results, , compared two. looks same. values same.

any ideas on should fix this?


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

jquery - Keeping Kendo Datepicker in min/max range -