Can you use the Python's request library in AWS Glue? Is there a replacement to the Requests library that can be used with Glue since Glue only supports pure python modules?
You can use the urllib package.
From the Documentation:
urllib is a package that collects several modules for working with URLs:
- urllib.request for opening and reading URLs
- urllib.error containing the exceptions raised by urllib.request
- urllib.parse for parsing URLs
- urllib.robotparser for parsing robots.txt files
A simple get request using requests
import requests
r=requests.get('http://www.python.org/')
print(r.text)
Alternative using urllib
import urllib.request
r=urllib.request.urlopen('http://www.python.org/').read()
print(r)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With