question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

r.html.render() does not update cookies? Manual extracting of cookies possible?

See original GitHub issue

These lines, actually

self.session = Requests(username, password).session
self.session.get('https://www.wanikani.com/dashboard').html.render()
self.session.get('https://community.wanikani.com/latest').html.render()

Which is from this project, where I simulate by disabling/enabling Javascript.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:10

github_iconTop GitHub Comments

8reactions
pash99commented, Sep 9, 2018

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())
0reactions
hotdog5225commented, Nov 5, 2021

any solution to this problem now? resp.html.render() always without cookies…

Read more comments on GitHub >

github_iconTop Results From Across the Web

requests-html - Unable to render() html with cookies
I need to render a page for scraping with requests-html in python. No matter what I have tried, I've been unsuccessful with getting...
Read more >
How to handle cookies in Django - The way to set cookies
The session variable is available in the settings that are used to handle session cookies. We can enable and disable the cookie manually...
Read more >
Cookies: HTTP State Management Mechanism
Cookies : HTTP State Management Mechanism. Abstract. This document defines the HTTP Cookie and Set-Cookie header fields.
Read more >
requests-HTML v0.3.4 documentation
Note, the first time you ever run the render() method, it will download Chromium ... send HTMLSession.cookies convert. cookies – If not empty...
Read more >
Safari Technology Preview Release Notes - Apple Developer
Fixed extensions showing a UUID instead of their name for cookie entries ... Updates to Safari Technology Preview are no longer available for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found