Duff360 Posted May 18, 2017 Share Posted May 18, 2017 (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 June 7, 2017 by Duff360 Link to comment Share on other sites More sharing options...
Danp2 Posted May 18, 2017 Share Posted May 18, 2017 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? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Duff360 Posted May 18, 2017 Author Share Posted May 18, 2017 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!! Link to comment Share on other sites More sharing options...
Danp2 Posted May 19, 2017 Share Posted May 19, 2017 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. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now