allcapone1912 Posted January 18, 2015 Posted January 18, 2015 hi, need some help i use FFXpath to get text by div class but i have a problem the page have more than one div class = data_field_value and i want to get them all with my current code i get only the first text $sText = _FFXpath("//div[@class='data_field_value']", "textContent", 2) can someone help me to get all text from div class 'data_field_value'
Danp2 Posted January 18, 2015 Posted January 18, 2015 Look at the documentation for _FFXPath and the included examples. Changing the value of the 3rd parameter lets you adjust the return type. Latest Webdriver UDF Release Webdriver Wiki FAQs
Solution jdelaney Posted January 18, 2015 Solution Posted January 18, 2015 (edited) $xml = "<xml><div class='data_field_value'>test1</div><div class='data_field_value'>test2</div></xml>" $oXML = ObjCreate("Microsoft.XMLDOM") $oXML.loadXML($xml) $oDivs = $oXML.selectNodes("//div[@class='data_field_value']") For $oDiv In $oDivs ConsoleWrite($oDiv.text & @CRLF) Next Output: test1 test2 Edited January 18, 2015 by jdelaney allcapone1912 1 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.
allcapone1912 Posted January 18, 2015 Author Posted January 18, 2015 On 1/18/2015 at 4:29 PM, jdelaney said: $xml = "<xml><div class='data_field_value'>test1</div><div class='data_field_value'>test2</div></xml>" $oXML = ObjCreate("Microsoft.XMLDOM") $oXML.loadXML($xml) $oDivs = $oXML.selectNodes("//div[@class='data_field_value']") For $oDiv In $oDivs ConsoleWrite($oDiv.text & @CRLF) Next Output: test1 test2 thanks,its work
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