4

I am not able to get a value of second attribute based on first attribute. I try to get value of content attribute. i.e. 4,450 out of following XML:

<meta itemprop="price" content=" 4,450" />

Tried with this XPath: //meta[@itemprop=\"price\"][@content] But I'm getting output similar to the input XML.

1
  • Consider accepting on of the provided answers. Thanks. Commented Dec 26, 2014 at 18:53

2 Answers 2

3

You need a slash before the content attribute:

//meta[@itemprop='price']/@content
Sign up to request clarification or add additional context in comments.

Comments

3

The usage is incorrect.

Use the following code

//meta[@itemprop=\"price\"]/@content

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.