Questions tagged [urllib3]

`urllib3` is a 3rd-party Python HTTP library with thread-safe connection pooling, file post, and more.

urllib3 is a library for python 2 and 3 providing a HTTP API with thread-safe connection pooling, file posting support, redirection handling and retries.

Documentation can be found at https://urllib3.readthedocs.io/en/latest/

760 questions
-1
votes
1 answer

Network is unreachable for Flask app on Apache

I have a simple Flask application hosting a form for a data input into local db. I am validating one of the field with wdsl service with python zeep (simply checks if VAT exists with…
-1
votes
1 answer

The 'html2text' module not working when using with 'urllib.request' module

I want to get all the text of a webpage and therefore I am trying to use html2text module with the urllib.request module-- import urllib.request import html2text request_url =…
dev Asur
  • 44
  • 7
-1
votes
2 answers

ModuleNotFound in python 3.7

i am getting this error in cmd prompt : No module named 'urllib.request' i have installed pip and requests packages still i am getting this import urllib.request, urllib.parse, urllib.error fhand =…
-1
votes
1 answer

I can't use urllib3 or urllib in python 3.8

I just installed urllib3 using pip command and was successful, and when i use import urllib3 or import urllib its showing a huge error. Why this happening?. Please help. This is my error: when use import urllib or import urllib3 and running in…
Mubin_Hardy
  • 53
  • 1
  • 9
-1
votes
1 answer

Download files from a website using python

I am new to Python and I have a requirement to download multiple csv-files from a website authenticated using username and password. I wrote the below piece of code to download a single file but unfortunately the contents in the downloaded file are…
-1
votes
1 answer

Unshorten url in python 3

I am using this code for unshortening urls in python 3 , but the code returns the url as it is (shortened), so what should I do to get it unshortened? import requests import http.client import urllib.parse as urlparse def unshortenurl(url): …
Youcef
  • 1,103
  • 2
  • 11
  • 26
-1
votes
1 answer

Python urllib3 opening url

import urllib2 data = [] req=urllib2.Request("https://raw.githubusercontent.com/plotly/datasets/master/miserables.json") opener = urllib2.build_opener() f = opener.open(req) data = json.loads(f.read()) How to maintain the same functionality using…
Ananya Bal
  • 11
  • 2
-1
votes
2 answers

ImportError: No module named 'requests.packages.urllib3'

I am testing an application and I am getting the above error "ImportError: No module named 'requests.packages.urllib3'" Below are the details. [root@lab ~]# python /opt/test/panda_API.py Traceback (most recent call last): File…
mobgenny
  • 21
  • 1
  • 2
-1
votes
2 answers

concurrent connections in urllib3

Using a loop to make multiple requests to various websites, how is it possible to do this with a proxy in urllib3? The code will read in a tuple of URLs, and use a for loop to connect to each site, however, currently it does not connect past the…
dataviews
  • 2,466
  • 7
  • 31
  • 64
-1
votes
1 answer

Printing data from a static xml file

I am trying to find product names in an xml file i downloaded. I have figured out how to display every result using a while loop. My problem is, i want to only display the first 10 results. Also, i need be able to call each result individually. For…
Tomble
  • 53
  • 2
  • 12
-1
votes
3 answers

Python, append curl results to list with urllib3

I am trying to append the results from a curl request using urllib3 to a list. You can see from my below attempt that I am out of my depth already :) import urllib3 import json import csv http = urllib3.PoolManager() r = http.request('GET',…
-1
votes
1 answer

Do something on connection error apart from retry with python requests

I am using Python requests to make a post request. I am trying to do something like this as shown in below post: Retry with requests When there is connection error or response status code received is from status_forcelist, it should retry(which is…
rsnhah
  • 349
  • 4
  • 15
-1
votes
2 answers

Import error for urllib3

I'm using Python 2.7 and am trying pull data from an API using a python script and urllib3. I've installed urllib3 by copying the source code but from GitHub. But, I'm still getting the following error when running the script: ImportError: No…
-1
votes
1 answer

Code keeps producing an empty string

I do not understand why the following code keeps producing an empty string. I am trying to get the code to extract the contents of the website to a "txt" file, but it just keeps producing an empty string. Is there an error in the code? import…
Cloud
  • 399
  • 4
  • 13
-1
votes
1 answer

What is the urllib3 documentation telling me to do?

I am trying to get a Kilo OpenStack cloud deployed and I was getting this error: Execution of '/usr/bin/openstack token issue --format value' returned 1: /usr/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:90: …
Red Cricket
  • 9,762
  • 21
  • 81
  • 166
1 2 3
50
51