|
Rank: Newbie Groups: Member
Joined: 10/28/2016 Posts: 5
|
I am using webview to load a url, after loaded, it has some html element, are generated or value are assign during run time or after document has finished loaded. And I couldn't get the element value at run time...
Because i need to use javascript to run some javascript function which function already defined in the website.
But i noticed that cannot be done using EvalScipt.
Eg. NavigationTask nv = null;
nv = eoWebControl.WebView.LoadUrl(url); nv.WebView.LoadCompleted += WebView_LoadCompleted;
webReq = new Request(url);
void WebView_LoadCompleted(object sender, LoadCompletedEventArgs e) { if (e.Task.IsDone()) { MessageBox.Show("load completed: " + e.Url.ToString()); } }
private void btnGetEle_Click(object sender, EventArgs e) { string getEleJs = @"document.getElementById('myframe').contentDocument.embeds[0];";
object obj = eoWebView.EvalScript(getEleJs); // this return EO.WebBrowser.JSUndefined }
the html document look as follow
<html> <head> <title></title> </head> <body> <frameset> <frameset> <frame id="myframe"> <body> <div> <object> <param ..... /> <param ..... /> <param ..... /> <param ..... /> <embed src="" /> </object> </div> </body> </frame> </frameset> </frameset> </body> </html>
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
You can try to run the same code in Google Chrome's DevTools console window, do you get a valid value?
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 10/28/2016 Posts: 5
|
Yes, I can get it from google chrome inspect element console windows. But cannot get from the code i mentioned.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, In that case please try to isolate the problem into a test project and send the test project to us: https://www.essentialobjects.com/forum/test_project.aspxOnce we have that we will be happy to investigate further. Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
We have received your test project however the Url in your test project displays the following message "Viewing and using this website at your current location is prohibited due to its regulatory rules". Obviously this is not the intended result. As such you may want to host a duplicate copy of the test page in a separate test application and remove such restrictions for your test application.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 10/28/2016 Posts: 5
|
do you have vpn?? try to use malaysia server vpn.. tq
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
Please try to construct a test HTML file that demonstrates the problem and send us the test file.
Thanks!
|
|