Reputation: 261
I am trying to get the text from a div that is nested. Here is the code that I currently have:
sites = hxs.select('/html/body/div[@class="content"]/div[@class="container listing-page"]/div[@class="listing"]/div[@class="listing-heading"]/div[@class="price-container"]/div[@class="price"]')
But it is not returning a value. Is my syntax wrong? Essentially I just want the text out of <div class="price">
Any ideas?
The URL is here.
Upvotes: 0
Views: 539
Reputation: 4511
The price is inside an iframe so you should scrape https://www.rentler.com/ksl/listing/index/?sid=17403849&nid=651&ad=452978
Once you request this url:
hxs.select('//div[@class="price"]/text()').extract()[0]
Upvotes: 1