0

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.

4

1 回答 1

1

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]
于 2013-10-16T23:45:41.920 回答