Jump to content

get text from internet explorer


jmp
 Share

Recommended Posts

I am trying to read 310.00 from <td>, But it returning empty

#include <IE.au3>
#include <Array.au3>
$oIE = _IEAttach ("Shop")

Local $totPri = '<td style="text-align: right;" colspan="5">Total Price&nbsp;</td>' , $totPri = "0"
Local $oTds = _IETagNameGetCollection($oIE, "td")
For $oTd In $oTds
    If $oTd.InnerText = $totPri Then
        $totPri = $oTd.NextElementSibling.innertext
    EndIf
Next
MsgBox (0, "", $totPri)

HTML :

1647504108_totalprice.JPG.65ae21b5f2e090ac9239f9f2652c3729.JPG

Link to comment
Share on other sites

I would try to read the whole table with the _IETableWriteToArray () function and then analyze the data in the returned array, I think it should be more convenient.

however, in your script you declare the variable $totPri first with a string and immediately after with a "0".

Local $totPri = '<td style="text-align: right;" colspan="5">Total Price&nbsp;</td>' , $totPri = "0"


Since the InnerText property returns only the contents of the cell and not the entire Tag, you should compare the string returned by $oTd.InnerText with "Total Price". then try declaring the variable as

Local $totPri = "Total Price"

and it should work.

Edited by Chimp

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

i am trying to get text from label between <td> tag but it was say not found.

#include <IE.au3>
$oIE1 = _IEAttach ("Shop")
Local $stext = ' Bhindi'
;~Local $oTds = _IETagNameGetCollection($oIE1, "label")
Local $oTds = _IETagNameGetCollection($oIE1, "td")
For $oTd In $oTds
   If $oTd.InnerText = $stext Then
        $iStext = $oTd.NextElementSibling.InnerText
           MsgBox(0, "Found", $iStext)
   Else
           MsgBox(0, "", "Not Found")
     EndIf
Next
<tr title="" style="width: 25px;" data-original-title= Enter amount to take!" data-toggle="tooltip" data-placement="bottom">
                                    <td><label for=""> Bhindi</label> </td>
                                    
                                    <td>10.500</td>
                                    <td>32.00</td>
                                    <td>

 

Link to comment
Share on other sites

15 minutes ago, Danp2 said:

Isn't this the same problem as described in your previous thread? If so, why not respond there instead of starting all over in a new one?

 

@Danp2 My previous problem is solved, but this is my different problem, there are text in label. 

Link to comment
Share on other sites

  • Developers
2 hours ago, jmp said:

@Danp2 My previous problem is solved, but this is my different problem, there are text in label. 

Does look the same to me as well, and since you didn't have the courtesy to report as such, one can only assume it is the same ....

Merged and stick to one thread in the future!

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...