xpath


XPATH to extract data from CarWale.com?


With help from a friend I made a script to extract all specs and features from pages like http://www.carwale.com/mercedesbenz-cars/e-class/e63amg-3049/
, it works but not perfectly.
He told me to use XPath //tr[contains (.,"FEATURE NAME")]/td[2], but one of them is impossible to pick, using //tr[contains (.,"Display")]/td[2] it extract 4 features containing word Display. Is there any way to pick only the one labelled exactly Display?
<td>Trip Meter</td><td>Multi-Function Display </td>
<td>Heads Up Display (HUD)</td><td>No </td>
<td>Display</td><td>LCD Display </td>
<td>Display Screen for Rear Passengers</td><td>No </td>
I also extracted car color names using XPath //div[#class='colorName']
I want also car color RGB values, or whole style code and remove unneeded code using find/replace, what XPath I 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: '),';')

Related Links

How can I use an XPATH to populate a drop-list in Sitecore WFM?
How to get both following-sibling::text() and following-sibling::b?
Scrapy xpath fail to find certain div in a webpage
Scrapy: Issues in dealing with Abbr tag in Xpath
XPath for ImportXML in Gsheet
XMLStarlet: selecting nodes using less than / greater than
Date range comparison in CQ using XPATH
I don't understand why this XPath expression is not working as a Scrapy selector
Selenium IDE, check (assert) if a dynamic element contains a specific text
xpath help to get buttons under a class where a link contains some href value
How to write xpath for below code displayed on Image
Fetch element child elements in XQuery
Quickly extract value using xpath
WSO2 ESB- Error Handling - On Error Sequence
Multiple xpath expressions
great ancestor & great great ancestor

Categories

HOME
class
antd
semantic-web
portable-class-library
mirc
elk-stack
sympy
siesta
fasm
spring-amqp
freertos
bundler
webstore
django-rq
rest-assured
jqxgrid
scala-ide
spring-shell
spyder
quantitative-finance
opentext
plyr
window-managers
math.js
cube
locks
autodesk-model-derivative
series
riotjs
advanced-filter
cloveretl
restful-architecture
jslint
recovery
google-now
task-parallel-library
suds
plane
resampling
access-denied
rightnow-crm
nonlinear-functions
md5-file
password-hash
non-linear-regression
sonicmq
sigsegv
sequence-diagram
glassfish-4.1
fitbit
maatwebsite-excel
java-2d
nclam
data-management
yii2-model
odesk
helm
linuxbrew
self
lowercase
chicagoboss
ambiguity
blank-line
auto-generate
dynamics-ax-2012-r2
alwayson
whitespace-language
text-align
debug-symbols
ecos
coding-efficiency
autonumber
application-server
notifyjs
acceptance-testing
sunstudio
asp.net-mvc-3-areas
dojo-1.9
daap
struts2-json-plugin
getproperty
viewpagerindicator
jdom
prototypal-inheritance
qtextbrowser
will-paginate
firefly-mv
botnet
page-curl
kext
directshow.net
aptitude
bass
tabbarcontroller
source-code-protection
xap
sqlsitemapprovider
comment-conventions
downloadfile
html-generation
parentid

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App