進捗
12/24 17:40~19:00
headline_datetime_list = soup.find_all(class_ = 'update')
for headline_datetime in headline_datetime_list:
datetime_text = headline_datetime.get_text()
#1.ここまでのコードは日付を抽出する
headline_html_list = soup.find_all(class_ = 'headline')
for headline_html in headline_html_list:
for update in soup.find_all(class_ = 'update'):
update.decompose()
headline_text = headline_html.get_text()
#2.ここまでのコードは日付を削除して見出しを抽出する。
- 調べること
- 上段1のコードと下段2のコードを逆に書いても日付と見出しは分離して表示されるか
- decomposeを調べて下記のサイトにあるsrc=Falseとはなにか
- https://stackoverflow.com/questions/23516520/beautifulsoup-remove-all-the-internal-javascript/23516633#23516633
https://teratail.com/questions/75241