Scraping definition lists without id?

24 views
Skip to first unread message

JEBI93

unread,
Nov 27, 2014, 5:24:45 PM11/27/14
to scrapy...@googlegroups.com
Is there any way i can scrape elements like this: http://i.imgur.com/pRbzL2h.png
The url is: http://www.whitebearautos.com/used/Audi/2008-Audi-A3-ddc841510a0a00de7db60364121a4859.htm
So some of cars don't have VIN or Model code, so if let's say car doesn't have VIN number and has Model code because there's none class id it will print Model code instead of VAT.
 btw I'm using ItemLoader.

Nicolás Alejandro Ramírez Quiros

unread,
Nov 27, 2014, 7:43:37 PM11/27/14
to scrapy...@googlegroups.com
this should work.
stock_number = (//span[text()="Stock Number"]/following::dd)[1]//text()
vin = (//span[text()="VIN"]/following::dd)[1]//text()

JEBI93

unread,
Nov 30, 2014, 12:35:16 PM11/30/14
to scrapy...@googlegroups.com
Thanks, it worked!
Reply all
Reply to author
Forward
0 new messages