Can some one tell me the best way to get the contents using HTMLAgilityPack that i mention below from the html.
In the HTML provided i need to scrape value
of the ID "img" and set the values for x
and y
for them to be used in another function.
The relevant HTML is
<div id="values">
<input type="hidden" id="x" name="x" value='0' />
<input type="hidden" id="y" name="y" value='0' />
<input type="hidden" id="img" name="img" value="86932" />
<input type="hidden" id="source" name = "source" value="center" />
These values are being sent to the function in the javascript displayed below
submitClick(document.getElementById("img").getAttribute("value"),
document.getElementById("x").getAttribute("value"),
document.getElementById("y").getAttribute("value"),
'tiled' );
Can some body help me out by telling how i should proceed ...
I have written the following code that gets me the html data for the page
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url);
request.Method = "GET";
using (var stream = request.GetResponse().GetResponseStream())
using (var reader = new StreamReader(stream, Encoding.UTF8))
{
result = reader.ReadToEnd();
}
HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
doc.Load(new StringReader(result));
HtmlNode root = doc.DocumentNode;
Now that i have got the root how should i search for the parameters and then send them by GET.