Neeeewbie Posted December 8, 2016 Posted December 8, 2016 Hello, I'm trying read some IE page source code lines. simplified source code looks like: <div class=items-grid"> ....blah blah blah <div> <-start of first name div <Strong class="Card__name">name</strong> ....blah blah blah </div> <-end of first card div <div> <-start of 2nd name div <Strong class="Card__name">name2</strong> ....blah blah blah </div> <- end of 2nd name div </div> <- End of <div class=items-grid"> How wound I look in div class=items-grid and search for the Strong class="Card__name" text? Not asking for the full script just point me at something that can get me started and I'll be happy.
rootx Posted December 9, 2016 Posted December 9, 2016 Try this.. with strong... and class="Card__name" #include <IE.au3> #include <MsgBoxConstants.au3> $oIE = _IECreate ("http://www.google.com", 0, 0, 1, 0) $target = "" $tags = $oIE.document.GetElementsByTagName("div") For $tag in $tags $class_value = $tag.GetAttribute("class") If string($class_value) = "logo-subtext" Then $target = $tag ConsoleWrite("Tag Found " & $target.outerText&@CRLF) ExitLoop EndIf Next _IEQuit ($oIE)
jdelaney Posted December 9, 2016 Posted December 9, 2016 (edited) You can use an xpath, in my signature function... something like //div[@class='items-grid']/Strong Then get the attribute value of classname. Edited December 9, 2016 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
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