我对python和数据挖掘还不熟悉,所以我有一个关于从输出中提取部分的问题。我在3.6中使用Python,今天早上已经更新了所有的东西。我已经匿名输出并删除了包含密码、令牌等的所有行。在
from bs4 import BeautifulSoup
soup = BeautifulSoup(open("facebookoutput.html"), "html.parser")
comments = soup.findAll('div', class_="_2b06")
print(comments[0]) # show print of first entry:
<div class="_2b06"><div class="_2b05"><a href="/stuartd?fref=nf&rc=p& amp;__tn__=R-R">some Name </a></div><div data-commentid="100000000000000000222222000000000000000" data-sigil="comment-body">There is nice comment. I like stackoverflow. </div></div>
我很惊讶得到一个很好的评论。我喜欢stackoverflow。别这样。在
提前谢谢。在
试试这个:
输出:
^{pr2}$相关问题 更多 >
编程相关推荐