I'm using HtmlAgilityPack
for get some soccer events from this site.
The event that I'm grabbing are inside the All
tab. So essentially what I did is get the table where all events are located like this:
string url = "http://it.soccerway.com/";
string data = new WebClient().DownloadString(url);
var doc = new HtmlDocument();
doc.LoadHtml(data);
var table = doc.DocumentNode.SelectSingleNode("//table[@class='matches date_matches grouped ']");
in the next time I get all the visible event, so all the div that have the class group-head expanded loaded
:
var tableTrHeader = table.SelectNodes("//tr[@class='group-head expanded loaded ']");
and next iterate it. All of this working good but I've a problem. Infact there are other event in the table, but unfortunately this doesn't have the class loaded
but simply have: group-head clickable
.
So I guess there is something in the js code of the site that perform an action or something like to get the details of clicked row.
I thought to load an html that have all the item expanded, but unfortunately I doesn't know an approach that allow me to send a click action on a specific target html element through c#. I suppose that HtmlAgilityPack
is not done for this target but only for scraping.
Someone have a workaround for this? Thanks.