Jump to content

Recommended Posts

Posted (edited)
Just now, alienclone said:

it is possible.

for Internet Explorer check out the IE.udf

for chrome or ff check out IUIAutomation

i am trying with this code :

#include <IE.au3>

$oIE = _IEAttach ("Home")

Local $date = "Be", $idate = "0"
Local $oTds = _IETagNameGetCollection($oIE, "li")
For $oTd In $oTds
    If $oTd.InnerText = $date Then
        $idate = $oTd.NextElementSibling.InnerText
    EndIf
Next

MsgBox(0, "date is", $idate)

But, 1) It was showing date with time, i want to read only date.

        2) Sometime the server changed then the previous li tag is : Be/Ga/De

 

Edited by naru
added code
Posted (edited)

If you are getting the correct string, just string split it after you get it with:

#include <IE.au3>

$oIE = _IEAttach ("Home")

Local $idate = "0"
Local $date[3] = ["Be", "Ga", "De"] ; Creating array with these options to compare against: Be/Ga/De

Local $oTds = _IETagNameGetCollection($oIE, "li")

For $y in $date ; Using an extra loop to loop through the array options to verify against all 3 possibilities
    For $oTd In $oTds
        If $oTd.InnerText = $y Then
            $idate = $oTd.NextElementSibling.InnerText
            $idate = StringSplit($idate, " ")
        EndIf
    Next
Next

MsgBox(0, "date is", $idate[1])

 

Edited by rm4453
Added For Loop to verify li vs all array options: Be/Ga/De
Posted
28 minutes ago, rm4453 said:

If you are getting the correct string, just string split it after you get it with:

#include <IE.au3>

$oIE = _IEAttach ("Home")

Local $idate = "0"
Local $date[3] = ["Be", "Ga", "De"] ; Creating array with these options to compare against: Be/Ga/De

Local $oTds = _IETagNameGetCollection($oIE, "li")

For $y in $date ; Using an extra loop to loop through the array options to verify against all 3 possibilities
    For $oTd In $oTds
        If $oTd.InnerText = $y Then
            $idate = $oTd.NextElementSibling.InnerText
            $idate = StringSplit($idate, " ")
        EndIf
    Next
Next

MsgBox(0, "date is", $idate[1])

 

error in last line

line21.JPG.012fe85f435f58d97ba797ee75afc53e.JPG

Posted
2 minutes ago, naru said:

error in last line

line21.JPG.012fe85f435f58d97ba797ee75afc53e.JPG

#include <IE.au3>

$oIE = _IEAttach ("Home")

Local $idate = "0"
Local $date[3] = ["Be", "Ga", "De"] ; Creating array with these options to compare against: Be/Ga/De

Local $oTds = _IETagNameGetCollection($oIE, "li")

For $y in $date ; Using an extra loop to loop through the array options to verify against all 3 possibilities
    $z = false
    For $oTd In $oTds
        If $oTd.InnerText = $y Then
            $idate = $oTd.NextElementSibling.InnerText
            $idate = StringSplit($idate, " ")
            $z = true
        EndIf
        If $z = true Then ExitLoop
    Next
        If $z = true Then ExitLoop
Next

If $z = true Then
    MsgBox(0, "date is ", $idate[1])
Else
    MsgBox(0, "DATE NOT FOUND: ", $idate)
EndIf

 

Posted
2 minutes ago, rm4453 said:
#include <IE.au3>

$oIE = _IEAttach ("Home")

Local $idate = "0"
Local $date[3] = ["Be", "Ga", "De"] ; Creating array with these options to compare against: Be/Ga/De

Local $oTds = _IETagNameGetCollection($oIE, "li")

For $y in $date ; Using an extra loop to loop through the array options to verify against all 3 possibilities
    $z = false
    For $oTd In $oTds
        If $oTd.InnerText = $y Then
            $idate = $oTd.NextElementSibling.InnerText
            $idate = StringSplit($idate, " ")
            $z = true
        EndIf
        If $z = true Then ExitLoop
    Next
        If $z = true Then ExitLoop
Next

If $z = true Then
    MsgBox(0, "date is ", $idate[1])
Else
    MsgBox(0, "DATE NOT FOUND: ", $idate)
EndIf

 

Getting empty Box :

line21.JPG.334e8beaff6901ccd0f95ab503f002e0.JPG

Some time the server is different than Be/Ga/De

Posted
Just now, naru said:

Getting empty Box :

line21.JPG.334e8beaff6901ccd0f95ab503f002e0.JPG

Some time the server is different than Be/Ga/De

what are the server options? you need a full list to compare against... also try changing the array output to 2 instead

Posted (edited)

Actually try this:

 

#include <IE.au3>

$oIE = _IEAttach ("Home")

Local $idate = "0"
Local $date[3] = ["Be", "Ga", "De"] ; Creating array with these options to compare against: Be/Ga/De

Local $oTds = _IETagNameGetCollection($oIE, "nav navbar-btn") ; Added Nine's Suggestion

For $y in $date ; Using an extra loop to loop through the array options to verify against all 3 possibilities
    $z = false
    For $oTd In $oTds
        If $oTd.InnerText = $y Then
            $idate = $oTd.NextElementSibling.InnerText
            $idate = StringSplit($idate, " ")
            $z = true
        EndIf
        If $z = true Then ExitLoop
    Next
        If $z = true Then ExitLoop
Next

If $z = true Then
    For $i = 1 To $idate
        MsgBox(0, "date is ", $idate[$i])
    Next
Else
    MsgBox(0, "DATE NOT FOUND: ", $idate)
EndIf

 

Edited by rm4453
Posted (edited)
35 minutes ago, rm4453 said:

what are the server options? you need a full list to compare against... also try changing the array output to 2 instead

@rm4453, @Exit Please Check out the webpage :  (for security reason i will delete it)

Edited by naru
remove webpage
Posted
3 minutes ago, rm4453 said:

Actually try this:

 

#include <IE.au3>

$oIE = _IEAttach ("Home")

Local $idate = "0"
Local $date[3] = ["Be", "Ga", "De"] ; Creating array with these options to compare against: Be/Ga/De

Local $oTds = _IETagNameGetCollection($oIE, "nav navbar-btn") ; Added Nine's Suggestion

For $y in $date ; Using an extra loop to loop through the array options to verify against all 3 possibilities
    $z = false
    For $oTd In $oTds
        If $oTd.InnerText = $y Then
            $idate = $oTd.NextElementSibling.InnerText
            $idate = StringSplit($idate, " ")
            $z = true
        EndIf
        If $z = true Then ExitLoop
    Next
        If $z = true Then ExitLoop
Next

If $z = true Then
    For $i = 1 To $idate
        MsgBox(0, "date is ", $idate[$i])
    Next
Else
    MsgBox(0, "DATE NOT FOUND: ", $idate)
EndIf

 

Not getting anything.

Posted (edited)
1 minute ago, naru said:

Not getting anything.

Oops one moment didn't write loop correctly:

 

#include <IE.au3>

$oIE = _IEAttach ("Home")

Local $idate = "0"
Local $date[3] = ["Be", "Ga", "De"] ; Creating array with these options to compare against: Be/Ga/De

Local $oTds = _IETagNameGetCollection($oIE, "nav navbar-btn") ; Added Nine's Suggestion

For $y in $date ; Using an extra loop to loop through the array options to verify against all 3 possibilities
    $z = false
    For $oTd In $oTds
        If $oTd.InnerText = $y Then
            $idate = $oTd.NextElementSibling.ClassName
            $idate = StringSplit($idate, " ")
            $z = true
        EndIf
        If $z = true Then ExitLoop
    Next
        If $z = true Then ExitLoop
Next

If $z = true Then
    For $i = 1 To $idate[0]
        MsgBox(0, "date is ", $idate[$i])
    Next
Else
    MsgBox(0, "DATE NOT FOUND: ", $idate)
EndIf
 
Edited by rm4453
Posted
3 minutes ago, rm4453 said:

Oops one moment didn't write loop correctly:

 

#include <IE.au3>

$oIE = _IEAttach ("Home")

Local $idate = "0"
Local $date[3] = ["Be", "Ga", "De"] ; Creating array with these options to compare against: Be/Ga/De

Local $oTds = _IETagNameGetCollection($oIE, "nav navbar-btn") ; Added Nine's Suggestion

For $y in $date ; Using an extra loop to loop through the array options to verify against all 3 possibilities
    $z = false
    For $oTd In $oTds
        If $oTd.InnerText = $y Then
            $idate = $oTd.NextElementSibling.ClassName
            $idate = StringSplit($idate, " ")
            $z = true
        EndIf
        If $z = true Then ExitLoop
    Next
        If $z = true Then ExitLoop
Next

If $z = true Then
    For $i = 1 To $idate[0]
        MsgBox(0, "date is ", $idate[$i])
    Next
Else
    MsgBox(0, "DATE NOT FOUND: ", $idate)
EndIf


 

Showing DATE NOT FOUND msgbox

Posted
Posted
Just now, naru said:

Got empty msg box, Please check webpage 

Here:

 

#include <IE.au3>

$oIE = _IEAttach ("Home")

Local $date
Local $oTds = _IETagNameGetCollection($oIE, "li")
For $oTd In $oTds
    If $oTd.className = "nav navbar-btn" Then
        $idate = StringSplit($oTd.NextElementSibling.InnerText, " ")[2] ; Because there is a space at beginning it parses that in first spot so we show 2nd
        ExitLoop
    EndIf
Next

MsgBox(0, "date is", $idate)

 

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
×
×
  • Create New...