I am trying to output some strings from a certain website and i want to add each row into a List. The output i am looking for looks like this:
string url = "https://thepiratebay.org/search/rick%20and%20morty/0/99/0";
HtmlWeb web = new HtmlWeb();
HtmlDocument doc = web.Load(url);
//upload list
List<string> uploadList = new List<string>();
foreach (HtmlNode node in doc.DocumentNode.SelectNodes("//table[@id='searchResult']/tr/td/font[@class='detDesc']"))
{
var input = node.InnerHtml.ToString();
//The [^0-9] expression is used to find any character that is NOT a digit, will replace with empty string
input = Regex.Replace(input, "([^0-9]+)"," ");
Console.WriteLine(input);
}
I need to store every row into a list in order to process each element of data and i can't manage to set doc.DocumentNode.SelectNodes("//table[@id='searchResult']/tr/td/font[@class='detDesc']")
into an array