Can I combine these two blocks into one:
Edit: Any other method than combining loops like Yacoby did in the answer.
for tag in soup.findAll(['script', 'form']):
tag.extract()
for tag in soup.findAll(id="footer"):
tag.extract()
Also can I multiple blocks into one:
for tag in soup.findAll(id="footer"):
tag.extract()
for tag in soup.findAll(id="content"):
tag.extract()
for tag in soup.findAll(id="links"):
tag.extract()
or may be there is some lambda expression where I can check whether in array, or any other simpler method.
Also how do I find tags with attribute class, as class is reserved keyword:
EDIT: this part is solved by the soup.findAll(attrs={'class': 'noprint'}):
for tag in soup.findAll(class="noprint"):
tag.extract()