I am trying html-scraping for fun and my question is. This Response.write() method works from inside the try catch block on IDE. But it doesnt return the Response.write() method on the server.
try
{
if (x == 1)
{
Url = "https://www.**********.com/" + arama;
}
else
{
Url = "https://www.**********.com/" + arama + "?pagingOffset=" + y;
}
doc = web.Load(Url);
liste = doc.DocumentNode.SelectNodes("//*[@id=\"searchResultsTable\"]/tbody/tr[" + i + "]/td[1]/a")[0].Attributes["href"].Value;
Url = "https://www.**********.com" + liste;
doc = web.Load(Url);
liste = doc.DocumentNode.SelectNodes("//*[@id=\"classifiedDetail\"]/div[1]/div[2]/div[3]/div[1]/div/div[1]/h5")[0].InnerText;
liste2 = doc.DocumentNode.SelectNodes("//*[@id=\"phoneInfoPart\"]/li/span[1]")[0].InnerText;
count++;
liste = liste.ToUpper();
Response.Write(count + " - " + liste + " Tel: " + liste2 + "</br>");
}
catch { }
in short this web app using HtmlAgilityPack to find html values by their xpath and I use Response.write() to return the inside value while innertext() converts it to string for me.