xpath


xPath union statement with functions


thanks in advance for reading.
I'm using $x() xPath evaluator of Chrome console.
I need to match something shaped like $x("e1 | e2").
In my case:
e1:
(//div[#class='seven columns omega']//form//div[#class='items_left']//text())[2]
e2
(substring-after(//div[#class='seven columns omega']//span[#class='sold_out']/text(),' - '))
They both works in the single way but if i want to combine them I just get stuck in
"Failed to execute 'evaluate'..."
PS The problem is e2 function substring-after, without it the union works.
Any Ideas?
Here are the 2 sources i'm trying to extract:
e1-case
e2-case
Thanks again :)
Based on your comments that you want string values and expect only one of those expressions to find something on the same page you could simply try
var result = $x("string((//div[#class='seven columns omega']//form//div[#class='items_left']//text())[2])") + $x("(substring-after(//div[#class='seven columns omega']//span[#class='sold_out']/text(),' - '))")

Related Links

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
better selenium xpath is expecting
How to get only numbers from string with XPath
xpath expression to find url and data
Getting “count: Parameter must be a NodeSet” trying to count nodes with a specific numeric value

Categories

HOME
elasticsearch
memory
couchdb
softlayer
biztalk
tcp
liferay-7
moodle-api
swift2
apache-kafka-connect
gprs
firebase-dynamic-links
match
ex
jpa-2.0
fresco
pygobject
office-ui-fabric
string-formatting
nose
codefluent
spring-shell
angular2-highcharts
neo4j.rb
uislider
sybase-ase
fstar
oracleforms
annotation-processing
code-climate
audit
winsock
progid
series
appcode
mongoengine
bean-validation
pdfminer
tidal-scheduler
grunt-contrib-watch
utf
suds
slideshow
jacoco-maven-plugin
flipkart
jenkins-slave
spongycastle
sonarqube5.2
sharpdx
iptv
maven-jaxb2-plugin
http-basic-authentication
nitrousio
ipywidgets
fuzzer
dpkg
eclemma
meld
i2b2
textpattern
replicaset
ampersand
ocmockito
innerhtml
camus
ssmtp
maven-shade-plugin
pass-by-value
fat32
wicket-1.5
iodocs
ecos
property-injection
mod-perl
mft
infinite
ember-table
bcdedit
unicoins
proc-open
xmlwriter
simplecov
lynx
struts2-json-plugin
monocross
wiktionary
photo-management
grails-validation
jmenu
3des
bll
anonymous-types
eaccelerator
mygeneration
solandra
reliability
firephp
spring-modules
3270
jquery-effects
accumulator

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