Answers for "bs4 find element by name"

1

bs4 find element by name

>>> from bs4 import BeautifulSoup
>>> soup = BeautifulSoup('<META NAME="City" content="Austin">')
>>> soup.find("meta", {"name":"City"})
<meta name="City" content="Austin" />
>>> soup.find("meta", {"name":"City"})['content']
u'Austin'
Posted by: Guest on November-12-2020

Browse Popular Code Answers by Language