Persist / Serialize BeautifulSoup/ResultSet object?

37 views
Skip to first unread message

Markur Sens

unread,
May 13, 2022, 6:45:30 AMMay 13
to beauti...@googlegroups.com
Hi,

I’m trying to figure out if and how one can serialize a bs or even ResultSet object in a database.

The point is (assuming infinite disk space and zero throughputs) I can avoid reparsing the HTML payload and rely on it instead.
The straightforward way of pickling the bs4 object doesn’t seem to work (max recursion).

Theoretically, I can also aggressively cache the output of find_all(<tag>) for every possible tag - but ResultSet doesn’t seem to be serializable either.

The ideal scenario would be some kind of JSON-like encoding of the bs or rs object.

Ideas and recommendations are welcome.

Thanks.
Reply all
Reply to author
Forward
0 new messages