Learn Before
Code
BeautifulSoup Tag: name
The name attribute of a BeautifulSoup Tag is the name of the HTML tag that it corresponds to.
from bs4 import BeautifulSoup soup = BeautifulSoup('<ex class="example">\ This is an example</ex>', 'html.parser') tag = soup.ex # <ex class='example'>This is an example</ex> tag.name # 'ex'
0
1
Updated 2021-02-08
Tags
Python Programming Language
Data Science