I want to print an attribute value based on its name, take for example
I want to do something
The following works:
from bs4 import BeautifulSoup soup = BeautifulSoup('', 'html.parser') metas = soup.find_all("meta") for meta in metas: print meta.attrs['content'], meta.attrs['name']