Parameters: |
|
---|---|
Return type: | list plus attribute metadata |
Returns: | A list of BeautifulSoup tags plus a dict of metadata. The metadata includes the contents of the <title> tag and <meta> tags. The keys for the <meta> data is the contents of its name or http-equiv attribute. |
All kwargs are passed to BeautifulSoup’s findAll method. Valid keyword args:
Restricts the set of tags by name. examples:
name='b'
name=re.compile('^b')
name=['title', 'p']
name={'title': True, 'p': True}
name=True # this returns all tags. Useful when limiting by attrs
name=lambda tag: len(tag.attrs) == 2
Any other keyword arguments impose restrictions on Tag attributes.
The list returned also includes a metadata dictionary. This attribute aggregates all the metadata information from the page <head>. The <title> is included under the key title and any <meta> tags it finds. The metadata dictionary uses either the name attribute or http-equiv attribute of the <meta> tag for the key and the content attribute for the value.