我正试图用scrapy shell从数据库中删除联系人信息。。。你知道吗
<div class="info-section">
<h3>State(s) Served:</h3>
<p>Nationwide (US)</p> </div>
<div class="info-section">
<h3>Year Founded:</h3>
<p>1985</p> </div>
<div class="info-section">
<h3>Description:</h3>
<p>Corporate tax accounting/consulting. Specialties: 280E Compliance/Planning, Research & Development Tax Credits, Cost Segregation, IRS Representation, Certified Financial Auditing.</p> </div>
<div class="info-section">
<h3>Contact:</h3>
<p><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="93f1e1eaf2fdd3f0e3f2fef7bdf0fcfe">[email protected]</a> | 847-382-1166 X28</p>
</div>
我使用sel = response.css('.info-section')
选择了info部分,然后我可以迭代p
元素,但是如何只选择包含联系人信息的<h3>
标记,然后获得<p>
文本?你知道吗
如果您需要通过电子邮件获取
<p>
之后的<a>
文本,您可以尝试以下方法:甚至更短,正如@Jack Fleeting所说:
相关问题 更多 >
编程相关推荐