|
Rank: Newbie Groups: Member
Joined: 8/12/2022 Posts: 3
|
This is my code: var script = @" var td_elements = document.getElementsByTagName('div'); var a_elements =[]; if(td_elements != null) { for (int i=0; i< td_elements.length; i++) { if(td_element[i].getAttribute('className') == 'dgdan') { if(td_element[i].Document.getElementsByTagName('p') != null) { var p = td_element[i].Document.getElementsByTagName('p'); } for(int y = 0; y < p.length; y++) { var b = p[i].getElementsByTagName('b'); if(b.innerText != null && b.innerText.Contains('đầu tư')) { return b.innerText; } } } } } ";
JSObject links = (JSObject)webview.EvalScript(script);// this error
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
What error do you get?
|
|
Rank: Newbie Groups: Member
Joined: 8/12/2022 Posts: 3
|
EO.WebBrowser.JSException: ', line 6, col 41 - 42: Uncaught SyntaxError: Unexpected identifier
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
This is an error in your JavaScript code. We are not in a position to troubleshoot your code. You will need to resolve such issues yourself.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 8/12/2022 Posts: 3
|
Can you give me an example of get elementbytagname, byclass?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
thành wrote:Can you give me an example of get elementbytagname, byclass? We do not provide support for general JavaScript programming. You need to seek other channels for such questions.
|
|