Welcome Guest Search | Active Topics | Sign In | Register

Get Element by ID from WebView Options
Michal Margielewski
Posted: Thursday, August 28, 2014 4:24:07 AM
Rank: Member
Groups: Member

Joined: 8/27/2014
Posts: 21
Hi,

In WebBrowser we search html element like this:
HtmlDocument doc = webBrowser1.Document;
string id = doc.All["ElementId"].GetAttribute("value");

How can we do it on your control webView ?
eo_support
Posted: Thursday, August 28, 2014 11:39:56 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

You would do something like this:

Code: C#
//Get the DOM element object
EO.WebBrowser.DOM.Element e = webView1.GetDOMWindow().document.getElementById("ElementId"];

//Use indexer to access a property
string name = (string)e["name"];


Alternatively, you can use this:

Code: C#
//Get the value of the name attribute for "ElementId"
webView1.EvalScript("document.getElementById('ElementId').name");


Hope this helps. Please feel free to let us know if you have any more questions.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.