Jump to content

FFXpath get all by div class


Go to solution Solved by jdelaney,

Recommended Posts

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

  • Solution

$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 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.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...