XPATH to extract data from CarWale.com? -
with friend made script extract specs , features pages http://www.carwale.com/mercedesbenz-cars/e-class/e63amg-3049/ , works not perfectly.
he told me use xpath //tr[contains (.,"feature name")]/td[2]
, 1 of them impossible pick, using //tr[contains (.,"display")]/td[2]
extract 4 features containing word display
. there way pick 1 labelled display?
<td>trip meter</td><td>multi-function display </td> <td>heads display (hud)</td><td>no </td> <td>display</td><td>lcd display </td> <td>display screen rear passengers</td><td>no </td>
i extracted car color names using xpath //div[@class='colorname']
i want car color rgb values, or whole style code , remove unneeded code using find/replace, xpath need?
<div class="colours" style="background-color: #040404; height: 30px; width: 130px; margin: 7px"></div>
extract 'td' tag containing 'display' if it's preceding sibling contains 'display':
//tr/td[contains(.,'display')]/following-sibling::td[contains(.,'display')]
extract rgb hex string:
//div/substring-before(substring-after(@style,'background-color: '),';')
Comments
Post a Comment