What I'm trying to do:
from requests_html import HTMLSession
with HTMLSession() as s:
s.get('url', cookies=my_cookie_jar)
s.html.render()
print(s.html.html)
I want to access a page where I need to log-in. I already logged in using a selenium browser, where I then exported the cookies as a RequestsCookieJar.
Now when I print the text returned by the get-request, I receive the text of the correct webpage (but without the javescript rendered), but as soon as I render the html the cookies seem to have no effect and I get the html of a page asking me to log in (the same I get when issuing the request without the cookies in the first place).
Now my question:
Is it possible to specify the cookies when rendering the html (or should requests-html already do this by default)?
Yes, you can, by using the kwarg cookies in render method.
s.html.render(cookies=my_cookie_jar)