XPath to get all including text except div
XPath to get all including text except div
I know how to exclude, but I don't know how to exclude a node but get everything else including the text.
So I use this XPath: //div[@class="web_description"]/*[not(div)]
on the HTML below. I want also the text outside <b>
tag. How can I do that?
//div[@class="web_description"]/*[not(div)]
<b>

<h5>Description</h5> The target is red-hot, currently scaling and <b>BRANDED AMAZON 5-STAR RETAILER IN THE</b> <b>PET AND ACCESSORIES </b>segment. This brand is realizing <b>over 200%YOY growth for 2018</b>, and boasts multiple Amazon’s Choice SKUs in the pets category – all of this bound up in a massively attractive and low-overhead FBA platform with broad appeal to all the major verticals in the pet space means this is one of <b>the most viable pet retail acquisition opportunities of 2018.</b><br>
<br>
With a valuable trademarked brand and proprietary product manufacturing, this business is perfectly positioned in a trending, high-volume vertical, and uniquely ready for new ownership to step in and hit the ground running with a profitable growth platform built-in to an easy-to-run eCommerce & Amazon foundation that has been laid, sealed, and gift wrapped for new ownership.<br>
<br>
The books and records on this great company are clean, making it a great opportunity for an SBA-backed loan. Qualified buyers can purchase this company for as little as <b>10% DOWN!</b><br>
<br>
Boasting multiple Amazon’s Choice SKUs, solid five-star feedback and multiple sales channels (Amazon, Chewy.com, eBay, DTC Website), this trademarked line of products has earned a reputation for top quality in its segment. Products are manufactured exclusively for the business, furnishing a line of SKUs catering primarily to the dog owner’s vertical (but spread out to reach other major pet verticals as well) all supplied primarily via FBA to allow for exceptionally low overhead and maximum flexibility in operations platform. This brand has wisely navigated its way into the natural and organic pet products space as well, smartly recognizing trends in the segment and beating competitors to the punch with a progressive offering.<br>
<br>
Competing in a vertical that not only typically sees high barriers to entry, but also fierce brand competition, this Company’s trade name is a recognized, known and a trusted brand in the industry, lending new ownership nearly endless opportunities for scale through international expansion, brick & mortar retail, and Amazon Subscribe & Save enhancement. Whether you choose to reap the benefits of international expansion or simply cash in on the sterling brand recognition of a company scaling like no other, the road to success for this business has been paved, mapped and made ready for absolutely any new owner.<br>
<br>
This eCommerce Retailer Represented by:<br>
<br>
WebsiteClosers.com<br>
Technology, Internet & Amazon Business Brokers</div>
1 Answer
1
Perhaps you want
//div[@class="web_description"]/node()[not(div)]
It's hard to be sure from your description.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
What is your exact desired output?
– Andersson
Jun 29 at 9:04