0
古いWebページからテキストを抽出しようとしましたが、問題があります。 Webページ(http://www.presidency.ucsb.edu/ws/index.php?pid=119039)のソースを検査、テキストが始まる:BeautifulSoupを使用してテキストを抽出する
> </div></div><span class="displaytext"><b>PARTICIPANTS:</b><br>Former Secretary of State
> Hillary Clinton (D) and<br>Businessman Donald Trump
> (R)<p><b>MODERATOR:</b><br>Chris Wallace (Fox News)<p><b>WALLACE:</b>
> Good evening from the Thomas and Mack Center at the University of
> Nevada, Las Vegas. I'm Chris Wallace of Fox News, and I welcome you to
> the third and final of the 2016 presidential debates between Secretary
> of State Hillary Clinton and Donald J. Trump.<p>
私が使用してテキストを抽出しようとしている:
link = "http://www.presidency.ucsb.edu/ws/index.php?pid=119039"
debate_response = requests.get(link)
debate_soup = BeautifulSoup(debate_response.content, 'html.parser')
debate_text = debate_soup.find_all('div',{'span class':"displaytext"})
print(debate_text)
をしかし、これは単に空リストを返します。どのように私はテキストを抽出することができます任意のアイデア?
まさに私が必要としたものです。ありがとうございました –