httpclient

Call apis on web with py-script

Call apis on web with py-script Question: I try to call an API with http.client th error says that the ‘http.client’ has no attribute ‘HTTPSConnection’ The code is: import http.client conn = http.client.HTTPSConnection("www.banxico.org.mx") payload = ” headers = {} conn.request("GET", "/SieAPIRest/service/v1/series/SP68257/datos/2022-11-11/2022-11-11?token=04021aac739b77e232d9670147936836e9e9fc31e08bde26665c0f013df94471", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) The code work well on …

Total answers: 2

How can I login to a website with Python?

How can I login to a website with Python? Question: How can I do it? I was trying to enter some specified link (with urllib), but to do it, I need to log in. I have this source from the site: <form id=”login-form” action=”auth/login” method=”post”> <div> <!–label for=”rememberme”>Remember me</label><input type=”checkbox” class=”remember” checked=”checked” name=”remember me” /–> …

Total answers: 7

Python urllib2 Progress Hook

Python urllib2 Progress Hook Question: I am trying to create a download progress bar in python using the urllib2 http client. I’ve looked through the API (and on google) and it seems that urllib2 does not allow you to register progress hooks. However the older deprecated urllib does have this functionality. Does anyone know how …

Total answers: 5