"Soup Strainer" for ElementSoup?

erikcw erikwickstrom at gmail.com
Sun Mar 23 11:48:44 EDT 2008


Hi all,

I was reading in the Beautiful Soup documentation that you should use
a "Soup Strainer" object to keep memory usage down.

Since I'm already using Element Tree elsewhere in the project, I
figured it would make sense to use ElementSoup to keep the api
consistent. (and cElementTree should be faster right??).

I can't seem to figure out how to pass ElementSoup a "soup strainer"
though.

Any ideas?

Also - do I need to use the extract() method with ElementSoup like I
do with Beautiful Soup to keep garbage collection working?

Thanks!
Erik



More information about the Python-list mailing list