allcapone1912 Posted January 18, 2015 Share 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' Link to comment Share on other sites More sharing options...
Danp2 Posted January 18, 2015 Share 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 Link to comment Share on other sites More sharing options...
Solution jdelaney Posted January 18, 2015 Solution Share 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. Link to comment Share on other sites More sharing options...
allcapone1912 Posted January 18, 2015 Author Share Posted January 18, 2015 $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 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