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,
Yep, name
can't be used in keyword-argument form to designate an attribute named name
because the name name
is already used by BeautifulSoup
itself. So use instead:
soup.findAll(attrs={"name":"description"})
That's what the attrs
argument 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!