Python 获取文本不';我不能为div标签工作
我正在浏览这个网站: 我想知道代币销售结束的日期,即“2月14日”。它存储在一个div标签中,该标签的类为“sale date”。但是,当我在这个div标记上调用“.get_text”时,我得到以下结果:Python 获取文本不';我不能为div标签工作,python,html,python-3.x,beautifulsoup,Python,Html,Python 3.x,Beautifulsoup,我正在浏览这个网站: 我想知道代币销售结束的日期,即“2月14日”。它存储在一个div标签中,该标签的类为“sale date”。但是,当我在这个div标记上调用“.get_text”时,我得到以下结果: <bound method Tag.get_text of <div class="sale-date">14 February</div>> 还有其他方法可以提取div标记中的文本吗?试试这个。您忘了在的末尾使用()。get_text应该是。get_te
<bound method Tag.get_text of <div class="sale-date">14 February</div>>
还有其他方法可以提取div标记中的文本吗?试试这个。您忘了在
的末尾使用()
。get_text
应该是。get_text()
:
试试这个。您忘了在
的末尾使用()
。get_text
应该是。get_text()
:
更改:
date = pt1.find(class_= "sale-date").get_text
致:
date = pt1.find(class_= "sale-date").get_text()
更改:
date = pt1.find(class_= "sale-date").get_text
致:
date = pt1.find(class_= "sale-date").get_text()