【发布时间】:2018-10-17 22:16:47
【问题描述】:
我正在尝试从此 div 中抓取文本
<div class="col-lg-6">
<h3 class="c-panel__section-heading">Reply</h3>
<div class="textAreaContainer closed">
<div contenteditable="true" class="customTextArea" id="Message" name="Message">
<p>Dear Customer, </p>
<p>the <span style="background-color: rgb(238, 238, 238);">MFDeviceMT.dll is a Matrox driver related dll, if you're not using a MATROX card on the server where you encountered the issue you can temporarily ignore it.</span></p>
<p><span style="background-color: rgb(238, 238, 238);">We have however forwarder the problem to our developing team, thank you for the feedback.</span></p>
<p><span style="background-color: rgb(238, 238, 238);">Best Regards.</span></p>
-------------- -------------- ----------- Email send to: martin.bonato@brasvideo.com;b2w.shoptime@brasvideo.com Email send cc: supporto@etere.com
</div>
</div>
</div>
但现在网站实现了标签
我不能刮掉所有的文字 我正在使用这个命令
sel.xpath('//*[@id="Message"]/text()').extract()[-1]
然后它返回
最后一个p标签中的所有文字
那么我怎样才能用 p 标签刮掉 div 中的所有文本
【问题讨论】: