I am scraping some data form website.
HTML is like this:
<!-- header section -->
<html>
<head>
<table class="inputsection" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td width="70%">
<script type="text/javascript">
var marketInfos = new Array();
marketInfos[0] =
createMarket('03/04 Annual Auction','1','Cleared');
Need to retrieve array marketInfos which has around 800 entries.
Tried using HTMLAgilityPack but it won't return the script data that I am looking for. Here is the actual html: Actual HTML
I tried to print innertext/html of all script nodes but the one that I am looking for is missing.
HtmlDocument doc = new HtmlDocument();
doc.LoadHtml(response);
foreach (HtmlNode node in doc.DocumentNode.SelectNodes("//table"))
{
foreach (var att in node.Attributes)
{
if (att.Name == "class" && att.Value == "inputsection")
{
Debug.WriteLine(node.InnerHtml);
Debug.WriteLine("+++++++++++++");
}
}
}
Is there a simple way to parse HTML to retrieve Javascript array variable to C# array ?