I am trying to read the description from the meta tag and this is what I used
soup.findAll(name="description")
but it does not work, however, the code below works just fine
soup.findAll(align="center")
How do I read the description from the meta tag in the head of a document?
Yep,
namecan’t be used in keyword-argument form to designate an attribute namednamebecause the namenameis already used byBeautifulSoupitself. So use instead:That’s what the
attrsargument is for: passing as a dict those attribute constraints for which you can’t use keyword-argument form because their names are Python keyword or otherwise taken by BeautifulSoup itself!