Quote:
Originally Posted by carmenchu
1. how to pass to soup.find_all() a list of tags as argument
|
You can use a list as the search parameter. For example:
Code:
tags = soup.find_all(['i', 'b', 'small', 'br'])
Quote:
Originally Posted by carmenchu
2. how to rework
Code:
if 'calibre' in tag['class']
so that it would match a substring, i.e., 'calibre15'.
|
You can use a
regular expression with
find_all().
Quote:
Originally Posted by carmenchu
3. Would the code work as well for selecting <meta... /> tag by 'name'
|
Yes, they're treated like all other tags.
Quote:
Originally Posted by carmenchu
[...]and deleting it? How?
|
You can delete tags with
decompose(). However, since this modifies the "soup," it should be done last.
Quote:
Originally Posted by carmenchu
** Does this get 'out of topic'? (better in plug-ins)
|
I also think it should be moved to plugins.