• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Problem finding xpath

shahin

Active Member
Hi there all!! Hope you are doing well. Could anybody tell me what will be the xpath to get the NAME which is "C15 Espresso" from the element I've pasted below?
Code:
<div class="body left">
                        <a class="listing-name" href="/wa/hammond-park/c15-espresso-1000001714962-listing.html?referredBy=www.yellowpages.com.au&amp;context=businessTypeSearch" title="View more about this business">C15 Espresso</a>
                        <p class="listing-heading"><a href="/find/cafes/hammond-park-wa" data-index-link="true">Cafes - Hammond Park, WA</a></p>

                        <p class="listing-short-description">Quality Food At Every Time</p>
                    </div>

Btw, I've already tried with these but no result:

1. //div[@class="body left"]/a[@class=listing-name]/text()
2. //a[@class="listing-name"]/text()
3. //div[@class="body left"]/a[@class="listing-name"]/@title
4. //a[@class="listing-name"]/@title
 
Found it. There might be others who also look for this sort.

1. //div[@class="body left"]/a[@class="listing-name" and @title="View more about this business"]/text()
2. //div[@class="body left"]/a[@class="listing-name"][@title="View more about this business"]/text()
3. //a[@class="listing-name" and @title="View more about this business"]/text()
4. //a[@class="listing-name"][@title="View more about this business"]/text()
 
Hi Marc L, it's nice to see you respond.:oops:!!! It's my mistake to seek an answer which is meant to satisfy my need concerning a certain code written in python.
 

Whatever Python or VBA following Document Object Model …
As XPath is an object and a property in XML model within VBA.

But for sure it's better to ask a Python question on a Python forum ! :cool:
 
Back
Top