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.,
If i understand well, you just want all the script tags, and then check for some attributes in them?
scriptTags = outputDoc.findAll('script') for script in scriptTags: if script.has_attr('some_attribute'): do_something()