【发布时间】:2021-10-18 20:56:18
【问题描述】:
我抓取了所有具有特定类的 li 标签并得到了输出:
<li>Aug 14-18, <a href="https://ai4good.org/fragile-earth-2021/">Fragile Earth 2021</a>, develop radically new technological foundations for advancing and meeting the Sustainable Development Goals. Online KDD-21 workshop.
</li>
<li>Aug 19-26, <a href="https://ijcai-21.org/">IJCAI-21: 30th Int. Joint Conference on Artificial Intelligence</a>. Montreal-themed Virtual Reality, Online.
</li>
我可以分别刮掉 href 和 text,但是我也想将日期存储在数据框的列中,或者至少单独获取日期。知道我该怎么做吗?
这是网站的链接:https://www.kdnuggets.com/meetings/index.html#Y21-10
【问题讨论】:
-
试试
link_text.split(', <')[0]:) -
请edit你的问题展示你到目前为止所做的尝试
-
请附上您的代码以及到目前为止您尝试过的内容。
标签: python beautifulsoup jupyter-notebook google-colaboratory