the short answer, as stated above, is to simply create a list from your generator.
like this: list(generator)
long answer and explanation why:
when you create a generator, or in your case a "listiterator", which is a generator that uses beautiful soup, you are not really creating a list of elements. you create an object (generator) that knows how to iterate through a certain number of elements, one at a time, ( next() )
what does it mean.
instead of what you want, and this, say, a book with pages.
you get a typewriter.
a typewriter can create a book with pages, but only 1 page at a time. Now, if you are just starting from the very beginning and looking at them in turn, like a loop, then yes, it is almost like reading a regular book.
but unlike a regular book, as soon as the typewriter ends with a page, you cannot go back, that page has already disappeared.
Hope this makes sense.
source share