JWiley

North Carolina

none

Age: 25

Just a man who wants to watch the world learn.

12h
comment XPATH Contain() Fuction Not Working for Multiple <div> Tags with Same Name
Right. And you're not importing a proper XML.
1d
revised Date change when converting from XMLGregorianCalendar to Calendar
added 35 characters in body
1d
awarded Promoter
1d
comment XPATH Contain() Fuction Not Working for Multiple <div> Tags with Same Name
I don't think you're quite understanding what I'm saying... XPath must be applied to valid XML. So however you're getting the data from the page, it needs to be in a valid block with beginning and ending tags, or no query will work at all (and you should be getting an error). The XPath I supplied works for your given snippet which I corrected to be valid xml in my test.
1d
comment XPATH Contain() Fuction Not Working for Multiple <div> Tags with Same Name
Is the XML you supplied the entirety of what you're trying to query? If so then it will fail because it is not a complete XML, no beginning/end tags. I added these for my test as I assumed this was only an excerpt. If you think this is related to where you're calling it from, try a simpler test with mock data in your spreadsheet and ensure that works first.
1d
comment XPATH Contain() Fuction Not Working for Multiple <div> Tags with Same Name
I used the XPath given in my answer and got back the <div> block containing the email address from the XML supplied in your question, so yes it does return data. Looks like you're doing something run in the implementation of it.
1d
revised XPATH Contain() Fuction Not Working for Multiple <div> Tags with Same Name
added 9 characters in body
Apr
9
comment Selecting specific non-empty nodes with Xpath
Add and text() != '' or and normalize-space(text()) != ''
Apr
8
comment Setting all elements with attribute to a certain value
@VikingBlooded Updated in regards to the empty tags
Apr
8
revised Setting all elements with attribute to a certain value
added 303 characters in body
Apr
8
comment Setting all elements with attribute to a certain value
Not sure what you mean, can you elaborate on that?
Apr
8
revised Setting all elements with attribute to a certain value
added 146 characters in body
Apr
8
comment Setting all elements with attribute to a certain value
Oh, well in that case use $node->nodeValue = value
Apr
8
answered Setting all elements with attribute to a certain value
Apr
8
comment XPATH: Get key name and value in on query
What have you tried?
Apr
8
awarded Informed
Apr
8
revised XPath: Help in locating a specific element in a DOM scraped using HTMLUnit
deleted 2 characters in body
Apr
8
comment XPath: Help in locating a specific element in a DOM scraped using HTMLUnit
Ah, yes I get what you're saying. // does start from the root of the node and search all of the contents, so you could remove it completely from the second XPath(relative vs absolute XPath) and you will only get the results within that <li> node, so they will never be mismatched. But from the snippet, it looks like there is only 1 company per <div class="listingWrapper" node, so this would work. Correct me if I'm wrong...
Apr
8
comment XPath: Help in locating a specific element in a DOM scraped using HTMLUnit
@GreenGodot Not sure I follow. How are you storing the number? You'll only get a telephone number for a company if the there is a child element under the <li> tag
Apr
8
revised XPath: Help in locating a specific element in a DOM scraped using HTMLUnit
deleted 62 characters in body
1 2 3 4 5