Is there any way to turn find_all into a more memory efficient generator? For example:
find_all
Given:
soup = BeautifulSoup(content, \"html.parser\
The simplest method is to use find_next:
soup = BeautifulSoup(content, "html.parser") def find_iter(tagname): tag = soup.find(tagname) while tag is not None: yield tag tag = tag.find_next(tagname)