【发布时间】:2019-04-24 01:41:41
【问题描述】:
到目前为止,我正在尝试在 value= 字段之后打印文本,输出看起来像这样。
<div class="controls"><input class="span12 text-bound" id="client_appbundle_prospecttype_name" maxlength="100" name="client_appbundle_prospecttype[name]" required="required" type="text" value="John Smith"/></div>
我的代码如下所示。
soup = BeautifulSoup(html, 'lxml')
contact = soup.find('div', {"class": "controls"})
print(contact)
如何打印“value=”后面的文本,所以只有 John Smith
谢谢!
【问题讨论】:
标签: python selenium beautifulsoup screen-scraping