0

I want to pass an Authentication object when creating a get request in requests_html. Also want to pass a file path for the certificate. This is what I have so far.

def get_url():
     s = HTMLSession()
     try:
         response = s.get(url)
     except Exception as e:
         logging.exception('Could not send get request: {}'.format(e))
     response.html.render()
     return response
1
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Commented Mar 8, 2024 at 5:12

1 Answer 1

0

To pass an Authentication object and a file path for the certificate when creating a get request in requests_html, you can use the auth and verify keyword arguments, respectively. Here is an example of how to do this:

import requests_html

def get_url():
    s = HTMLSession()
    try:
        response = s.get(url, auth=auth, verify=cert_path)
    except Exception as e:
        logging.exception('Could not send get request: {}'.format(e))
    response.html.render()
    return response

In this example, auth is an Authentication object and cert_path is the file path to the certificate.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.