Open patarapolw opened 6 years ago
not yet.
in the meantime, try html.render(reload=False)
So does this mean HTTP Basic Auth is not working when using render() ?
Any update on this issue? Thanks!
Extraction of cookies from rendered page:
import requests_html
import asyncio
my_url = "https://example.net"
with requests_html.HTMLSession() as s:
r = s.get(my_url)
r.html.render(keep_page=True)
l = asyncio.get_event_loop()
cookies = l.run_until_complete(r.html.page.cookies())
userAgent = l.run_until_complete(s.browser.userAgent())
# Make sure to close the page
l.run_until_complete(r.html.page.close())
Wondering if there's an update to this issue. I'm able to extract cookies and get the page I need fine. Once I make the call to render the page, the cookies disappear and the page renders my login page instead.
If you install from the repo, the requests_html.HTMLResponse.html.render()
function is updated to include a new parameter send_cookies_session: bool=False
. I used r.html.render(send_cookies_session=True)
and the webpage was no longer giving me an error about not accepting cookies.
I downloaded the latest head revision from git and installed it with pip. I tried it with three different parameters:
r.html.render(send_cookies_session=True)
r.html.render(keep_page=True)
r.html.render(reload=False)
None of these worked, i am always set back to the login page after calling the render()
method...
the problem remains. i use cookies to get url and then render it defaultly to get the html. but it returns only the html of login page. r.html.render(cookies=my_cookies) or r.html.render(send_cookies_session=True) returns error. that is render() got an unexpected keyword argument.
any solution to this problem now? resp.html.render() always without cookies.....
Any update on this issue?
Any Update ?
Bump to this. send_cookies_session
bool, reload=False
, and including cookies in the render() call (as detailed in readthedocs) return unexpected keyword arguments or fail to render the authed page (in the case of reload
).
These lines, actually
Which is from this project, where I simulate by disabling/enabling Javascript.