I would like to get all the tags in a document and then process each one based on the presence (or absence) of certain attributes.
E.g.,
For future reference, has_key has been deprecated is beautifulsoup 4. Now you need to use has_attr
scriptTags = outputDoc.findAll('script') for script in scriptTags: if script.has_attr('some_attribute'): do_something()