LoginSignup
1
1

More than 3 years have passed since last update.

Python: htmlデータからタグを除外する

Posted at

BeautifuleSoupでタグを除外

text = '<br />あか<br />あお<br />みどり<br />きいろ<br />'

import requests
from bs4 import BeautifulSoup

soup = BeautifulSoup(text,"html.parser")
soup_text = soup.get_text()

EXECUTION EXAMPLE

In [86]: soup_text
Out[86]: 'あかあおみどりきいろ'
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1