Hi all
I need to automate the navigation into some web sites and I am using B4A 9.80 with WebView and WebViewExtras2.
When I need to interact with web page I use JavaScript, for example:
and all work perfectly !!
But when I need to read the web page I have some problem.
If in the HTML source is used "id" tag, there are no problems, I use JavaScript code that read the correct element, and return to me its value.
But if the HTML source don't use "id" tag, I read all HTML codce with
and pass it to my app, but now I need to parse the HTML code for to find elements and extract the correct value.
For example, a <table> with <tr> and <td> inside it.
If it is an easy search, I use RegEx, but how can I do for to extract HTMLelement (or an array of HTMLelements) ??
In VB.NET now I use WebBrowser object and its DOM element, but how with B4A ??
Is there an HTML parse ??
Many thanks
Sergio
I need to automate the navigation into some web sites and I am using B4A 9.80 with WebView and WebViewExtras2.
When I need to interact with web page I use JavaScript, for example:
B4X:
wve.ExecuteJavascript("document.getElementById('username').setAttribute('value','myUserName'); " & _
"document.getElementById('password').setAttribute('value','myPassword!'); " & _
"document.getElementById('btnSubmit').click();")
Wait For wv_PageFinished
and all work perfectly !!
But when I need to read the web page I have some problem.
If in the HTML source is used "id" tag, there are no problems, I use JavaScript code that read the correct element, and return to me its value.
But if the HTML source don't use "id" tag, I read all HTML codce with
B4X:
document.documentElement.outerHTML
For example, a <table> with <tr> and <td> inside it.
If it is an easy search, I use RegEx, but how can I do for to extract HTMLelement (or an array of HTMLelements) ??
In VB.NET now I use WebBrowser object and its DOM element, but how with B4A ??
Is there an HTML parse ??
Many thanks
Sergio