我知道如何排除,但我不知道如何排除一个节点,而是获取包括文本在内的所有其他内容。
所以我使用这个xpath:
//div[@class="web_description"]/*[not(div)]
在下面的HTML中。我也要外面的文字
<b>
标签。我该怎么做?
<div class="web_description">
<div class="web_image">
<!--<img src="https://www.example.com/wp-content/uploads/website/Bodhi_CKERN.jpg" width="150" height="150" border="10">-->
<img src="https://www.example.com/wp-content/uploads/website/Bodhi_CKERN.jpg" width="150" height="150">
</div> <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>
Example.com<br>
Technology, Internet & Amazon Business Brokers</div>