(写真は小さいです。別のリンクがあります: 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.