python - XPATH: Specific word in paragraph -


i have been trying figure out how exact xpath e.g. third word in paragraph:

e.g.:

<p>here text</p> 

then if want third word ("some"), can't figure out how single out using xpath. however, focal point here not exact match of word "some", instead third word (whatever may be).

i have been trying this: ../p[3], doesn't help. use python , scrapy framework.

i hope can point me in right direction.

thank you.

if using scrapy, question tagged, consider using scrapy's .re() support, i.e:

>>> response.xpath('//p/text()').re('\w+')[2] u'some' 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -