hi everybody.
These days I written a JavaScript code that Helps me to do the following:
- I have a website that I need to do webscrapping, I do querys on this site.
Overtime that I make a Query and press the Search button Shows a “Wait a Moment message”. After the query has results, it shows a table with results, If not,shows a label with “No results”.
Basically It has two controls or panels as they call it.
- ctl00_MainContent_PnlNoResultados
- ctl00_MainContent_PnlResultados
by default both have hidden by CSS Attributes: “display:none”.
So for got the results, I proceed to use a SetTimeOut for wait that these controls change their states to “Visible” or “display:inline”.
And It works ok.
Thats the conditions that needs to meet:
If ctl00_MainContent_PnlNoResultados is Visible, Then Alerts “No available Results”
If ctl00_MainContent_PnlResultados is Visible, Then Alerts “Results Available”.
At this point everything its ok.
I’m doing this on a HTMLViewer.ExecuteJavascript().
There is the code:
Dim Banner As String= "setDDLday();" _
+"var HayDescargaSiONo;"_
+"function setDDLday() {" _
+" setTimeout(VerificaResultados,100);"_
+" function VerificaResultados() {" _
+" if ($('#ctl00_MainContent_PnlNoResultados').css('display') != 'none') {" _
+" alert('No Hay Resultados');"_
+" } else if ($('#ctl00_MainContent_PnlResultados').is(':visible')) {" _
+" alert('Si Hay Resultados');" _
+" } else {" _
+" setTimeout(VerificaResultados,100);" _
+" };" _
+" };" _
+"}"_
HTMLViewer1.ExecuteJavaScript(Banner)
But the really big problem “FOR ME” is how can I output the result displayed by the Alerts messages to Xojo, in order to use the results on Xojo?
Is this possible?
Thanks