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

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
How do I convert a string to an int variable in BizTalk XLANG?
extract table rows with XPATH
find the xpath of specific label
XPath filter attribute with namespace

Categories

HOME
powerbi
eclipse-plugin
systemd
antd
message-queue
loopbackjs
yql
cypher
azure-mobile-services
clone
stored-procedures
roku
alljoyn
fullcalendar-scheduler
createjs
mpu6050
stimulsoft
cuba-platform
django-rq
dma
pywinauto
nest-api
uima
web-deployment
tomcat8
android-contacts
susy-sass
office-ui-fabric
scheduled-tasks
deepfreeze
amazon-mws
spring-ldap
anova
workday
coreldraw
liferay-6.2
generator
qa
ini
high-availability
android-cardview
openbravo
tortoisehg
code-climate
dnsmasq
social-networking
amazon-iam
tightvnc
commonsware-cwac
seafile-server
mongoengine
cloudera-manager
xmlunit
serversocket
devtools
creation
formsauthenticationticket
gitolite
iscroll
pyttsx
fluid-mac-app-engine
transparency
android-5.0-lollipop
ol3-google-maps
photoswipe
ilrepack
simple-schema
palindrome
test-data
glassfish-4.1
hmmlearn
http4s
adobe-reader
controllers
rational-performance-test
pyaudio
always-on-top
raw-sockets
coovachilli
distributed-cache
utf-16
django-redis
diawi
grinder
android-studio-import
extend
blockquote
gql
wlanapi
embeddedwebserver
ipod
clarion
tree-structure
uno
configurable-product
window-resize
siena
screwturn
thruway
ivalueconverter
strdup
smips
compiler-flags
grails-2.3
non-ascii-characters
chartfx
sfinae
firebird1.5
algol68
background-repeat
space-partitioning
ognl
qcar-sdk
gaelyk
jdownloader
cleartype
asdoc
external-sorting
eai
downcasting
comment-conventions
isapi-redirect

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