Issue
I want to scrape the sold price of property from http://house.speakingsame.com/p.php?q=Brisbane+City&sta=qld
It has no formatting, no classes and the content is represented in tables.
what should I do in this case? Each table represents each property. I need the sold price for each property and hence each table.
response.css('tbody').getall()
returns nothing at all.
Solution
using xpath you could use:
for element in response.xpath("//table//table//table"):
sold = element.xpath(".//b")[0].xpath("./text()").get()
print(sold)
date = element.xpath(".//td")[0].xpath("./text()").get()
output:
Sold $640,000
Sold $640,000
Sold $320,000
Sold $320,000
Sold $145,000
Sold $145,000
Sold $145,000
Sold $145,000
Sold $239,000
Sold $239,000
Sold $695,000
Sold $695,000
Sold $740,000
Sold $740,000
Sold $375,000
Sold $375,000
Sold $390,000
Sold $390,000
Sold $695,000
Sold $695,000
Answered By - Alexander
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.