Skip to content
Advertisement

XPath Selector to get IMDB release Date

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

Advertisement

Answer

Just use :

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

or

//h4[contains(.,'Release')]/parent::*/text()[normalize-space()]
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement