div
Beautiful Soupモジュールを使用して、クラス名がであるタグのデータを取得するにはどうすればよいfeeditemcontent cxfeeditemcontent
ですか?それは...ですか:
soup.class['feeditemcontent cxfeeditemcontent']
また:
soup.find_all('class')
これはHTMLソースです:
<div class="feeditemcontent cxfeeditemcontent">
<div class="feeditembodyandfooter">
<div class="feeditembody">
<span>The actual data is some where here</span>
</div>
</div>
</div>
これはPythonコードです:
from BeautifulSoup import BeautifulSoup
html_doc = open('home.jsp.html', 'r')
soup = BeautifulSoup(html_doc)
class="feeditemcontent cxfeeditemcontent"