I have urllib3.response.HTTPResponse
(a "file-like" object) and lxml.html.lxml_parse
that takes only a file path, an URL or a "file-like" object (in case of HTTPResponse
it also extracts the URL). Also I need the content from the response.
The answers from Why can't I call read() twice on an open file? do not fit the situation since the stream consumes while reading into a variable and .seek
is not defined for HTTPResponse
.
copy.copy
and copy.deepcopy
do not work too.