XPath Selector to get IMDB release Date

Question:

I am practicing using Xpath selectors, and it seems to be very difficult to extract the release date from this website. I can get to the div class=’txt-block’, but not past that. I am trying to the get the date underneath it. E.g. "18 July 2008 (USA)"

https://www.imdb.com/title/tt0468569/?ref_=adv_li_tt

I can get up to this part. But I cannot get the text below.

Xpath screenshot

Asked By: dram95

||

Answers:

Just use :

//a[contains(@title,'release')]/text()

or

//h4[contains(.,'Release')]/parent::*/text()[normalize-space()]
Answered By: E.Wiest

You can use this expression to test in Chrome inspector:

$x(".//h4[contains(.,'Release')]/parent::*/text()[normalize-space()]")

enter image description here

Answered By: Bogdan Veliscu
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.