user
user

Reputation: 155

How to extract paragraph values in html when having multiple <p>?

I need to extract address, telephone using xPath from my html page. My html code is:

<div class="info-block-value"> ==$0
   <p>36 rue de la Verrerie 75004 PARIS</p>
   <p>Tél : 0111 222 222</p>
  </div>

I tried with, "xPath": "descendant::div[@class='info-block-value']/p But it shows me an error, as a newbie to xPath can someone help me? Also provide me a good tutorials, links etc.

Upvotes: 0

Views: 42

Answers (1)

supputuri
supputuri

Reputation: 14135

Here is the xpath.

Address:

(//div[@class='info-block-value']/p)[1]

Phone Number:

(//div[@class='info-block-value']/p)[2]

Upvotes: 1

Related Questions