stanf 43 Posted September 17, 2015 Report Share Posted September 17, 2015 can someone tell me how to isolate just the $14.99 <p class="sale-price"> $14.99 <span class="sale-was-price"> <s>$24.99</s> </span> <span class="sale-tag">Sale</span> </p> Quote Link to post Share on other sites
addy196 9 Posted September 17, 2015 Report Share Posted September 17, 2015 set(#newline,$replace("<p class=\"sale-price\"> $14.99 <span class=\"sale-was-price\"> <s>$24.99</s> </span> <span class=\"sale-tag\">Sale</span> </p>",$new line,$nothing),"Global") alert($find regular expression(#newline,"(?<=<p class=\\\"sale-price\\\"> ).*(?=<span class=\\\"sale-was-price\\\">)")) I dont know this will help you or not but I could not do it with xpath praser. Quote Link to post Share on other sites
stanf 43 Posted September 17, 2015 Author Report Share Posted September 17, 2015 yes i know i can read in the document text and regex to list,but that defeats the purpose of this exersise, as you can see the class atributes all share something "sale" or "price"what i need to learn is how to call just the eliment that i want,but thanx for the help thats why i love this place, folks aint shy about helping to work out a problem Quote Link to post Share on other sites
Bot-Factory 602 Posted September 17, 2015 Report Share Posted September 17, 2015 You can't extract only the first one just with Xpath. Because the innertext for the element <p class="sale-price"> is one "object".So it will return the complete thing. But in Ubot it's easy. Use xpath to get the innertext//p[@class="sale-price"] trim itadd to listuse first list item Dan Quote Link to post Share on other sites
stanf 43 Posted September 17, 2015 Author Report Share Posted September 17, 2015 Ok,i was hoping there was a way to isolate just the one. But thanx for clearing that up Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.