pyguymer3.download_text

pyguymer3.download_text(sess, url, /, *, cookies=None, debug=True, ensureNFC=True, headers=None, timeout=10.0, verify=True)[source]

GET a URL and return the text

This function performs a HTTP GET operation on a URL and returns the content as text, and optionally ensure that the Unicode encoding is NFC.

Parameters:
  • sess (requests.sessions.Session) – the requests session to use

  • url (str) – the URL

  • cookies (dict, optional) – the cookie jar

  • debug (bool, optional) – print debug messages

  • ensureNFC (bool, optional) – ensure that the Unicode encoding is NFC

  • headers (dict, optional) – extra headers to send

  • timeout (float, optional) – the timeout of the GET request

  • verify (bool, optional) – verify the server’s certificates

Returns:

textFalse if unsuccessful or a str if successful

Return type:

bool, str

Notes

Copyright 2017 Thomas Guymer [1]

References