(图片很小,这里是另一个链接:http: //i.imgur.com/OJC0A.png)
我正在尝试在底部提取评论的文本。我试过这个:
y = soup.find_all("div", style = "margin-left:0.5em;")
review = y[0].text
问题是未展开的div
标签中有不需要的文本,从评论内容中删除变得乏味。对于我的生活,我无法弄清楚这一点。有人可以帮我吗?
编辑:HTML是:
div style="margin-left:0.5em;">
<div style="margin-bottom:0.5em;"> 9 of 35 people found the following review helpful </div>
<div style="margin-bottom:0.5em;">
<div style="margin-bottom:0.5em;">
<div class="tiny" style="margin-bottom:0.5em;">
<b>
</div>
That is true. I tried it myself this morning. There's a little note on the Audible site that says "a few titles will require two credits" or something like that. A Dance with Dragons is one of those few.
文本上方的div标签如下:
<div class="tiny" style="margin-bottom:0.5em;">
<b>
<span class="h3color tiny">This review is from: </span>
<a href="https://rads.stackoverflow.com/amzn/click/com/B005C7QVUE" rel="nofollow noreferrer">A Dance with Dragons: A Song of Ice and Fire: Book 5 (Audible Audio Edition)</a>
</b>
</div>
That is true. I tried it myself this morning. There's a little note on the Audible site that says "a few titles will require two credits" or something like that. A Dance with Dragons is one of those few.