Can you find HTML elements in awesomium webcontrol to do the further processing?
For example, I can find necessary element (or even element collection) in Watin using:
Link playButton = myie.ElementOfType<Link>(Find.ById("myid")); // find link (<a>)
Div test = myie.Div(Find.ById("audio")); // find div (<div>)
When found - you can extract multiple properties of that element
string classname = playButton.ClassName; // alternatively -> inner text, link, id, class and all bucket of other properties
How do I do it in awesomium? Does it have built-in DOM parser to operate with website controls? (divs, links, tables, etc..)
So far I could only find javascript execution command but that's not what I'm looking for..
Additionally, I'd like to know how to save webpage's HTML to string (in awesomium)?
string mysite = webControl1.SiteHTML.ToString(); // something like this
// instead of
string mysite = webControl1.ExecuteJavascriptWithResult("document.documentElement.outerHTML").ToString();
EDIT: explaination
It looks like awesomium doesnt support HTML element parsing natively, so my backup plan is following:
- open webpage in awesomium
- grab HTML to string (currently using: ExecuteJavascriptWithResult())
- parse string to HTML (currently using: "HTML Agility pack")
- do what I need to do (find elements, collection, etc.)
- execute JS command in awesomium based on previous step results
All of this would be easier if awesomium had DOM support.. but.. well..