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 to capture a number of divs/ tables at once
multiple string() results for an xpath?
XQuery/XPath: Using count() and max() function for return of element with highest count
Double iteration over a nodeset in XSLT-1.0
What is the correct XPath query for 'select onchange'
XPath 2.0: Retrieving nodes by attribute where value is case Insensitive
XPath - abbreviation of position() function
XPath Query in JMeter
xpath expression to select attribute value
DOMDocument xpath query cut off time
How to parse the following html code get all text before “br” tag
XPath selector by class AND index
How to perform set operations in XPath 1.0
extract data from a div that have no class using xpath
Xpath: Select node but not specific child elements
XQuery - How to use eq (=) on a group of values

Categories

HOME
flask
firebase
libgdx
freeradius
bots
operating-system
mathematical-optimization
implicit-conversion
cdi
sympy
anchor
wine
yahoo
hystrix
yeoman-generator-angular
xamarin-zebble
cname
smartgwt
string-formatting
boomi
multiple-tables
unity-container
dashdb
perfino
sipp
ratio
spreadsheetgear
background-color
running-object-table
tf-idf
sfml
guice
series
john-the-ripper
db2-luw
testlink
strapi
selenide
python-sounddevice
microkernel
right-click
vb.net-to-c#
hypothesis-test
photoswipe
amazon-elastic-beanstalk
watir-webdriver
asp.net-web-api-routing
dcount
dmarc
callouts
dpkg
xcopy
utf-16
mnesia
json-spirit
outlook.com
deeplink
ibm-was
place
screen-orientation
espresso
artisan
azure-xplat-cli
python-curses
mutators
jcheckbox
thoughtworks-go
visual-studio-6
back
mobile-country-code
aho-corasick
accountmanager
gpu-programming
spring-social-linkedin
autonumber
spring-security-acl
compiler-flags
ntlmv2
semantic-merge
android-dialog
instance-variables
wcf-callbacks
yuidoc
mvcrecaptcha
servercontrol
mediacontroller
dip
outlook-2007-addin
icicles
aspbutton
version-control-migration
prism-2
suggestbox

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