Sign in to follow this  
Followers 0
Duff360

Get Inner Text From Active IE Tab

4 posts in this topic

#1 ·  Posted (edited)

Hello everyone,

I use _GetInnerText to get information from an Internet Web page with the following script:

Local $oIE = _IEAttach("Titre")
Local $aValues[1][3]
$aValues[0][0] = _GetInnerText('div', 'title')
$aValues[0][1] = _GetInnerText('div', 'source')
$aValues[0][2] = _GetInnerText('div', 'link')
Func _GetInnerText($sTagName, $sTagValue, $sTagType = 'className')
    Local $sResult, $oIETags
    $oIETags = $oIE.document.GetElementsByTagName($sTagName)
    For $oIEItem in $oIETags
        Switch $sTagType
            Case 'className'
                $sResult = $oIEItem.className
            Case 'id'
                $sResult = $oIEItem.id
        EndSwitch
        Switch $sTagName
            Case 'dd'
                If $sResult = $sTagValue Then Return
            Case Else
                If $sResult = $sTagValue Then Return $oIEItem.innerText
        EndSwitch
    Next
    Return
EndFunc

It works fine, but it gets information from the first tab.

Is there any way I can get the information from the active tab. All the tabs have unfortunately the same name.

Thank you very much,

Félix

Edited by Duff360

Share this post


Link to post
Share on other sites



#2 ·  Posted

9 minutes ago, Duff360 said:

Is there any way I can get the information from the active tab. All the tabs have unfortunately the same name.

If they all have the same name, then you'll need to change how you attach to the desired tab. Have you looked into using the $iInstance parameter of _IEAttach?

Share this post


Link to post
Share on other sites

#3 ·  Posted

I don't know how to do that! :)

I'm not good enough with AutoIT.

If someone has the solution it would be great otherwise it's fine.

Thanks!!

Share this post


Link to post
Share on other sites

#4 ·  Posted

You won't improve if you continue to depend on others to write code for you. Try reading the help file entry for _IEAttach. Look at the examples for some hints.

Share this post


Link to post
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
Sign in to follow this  
Followers 0