Questions tagged [urlretrieve]

54 questions
1
vote
2 answers

selenium.common.exceptions.InvalidArgumentException: Message: File not found while trying to upload image by url through selenium

I need to upload image via external url, i found examples only that shows how to upload locally stored images. This what i tried and this didn't…
Andrew
  • 1,507
  • 1
  • 22
  • 42
1
vote
1 answer

How to rerun a the script when an error occured?

I have written a script that search for values in xml file. This files I retrieve online via the following code # Reads entire file into a string $result = file_get_contents($xml_link); # Returns the xml string into an object $xml =…
Nemo
  • 503
  • 6
  • 23
1
vote
1 answer

Adding cookie data into a requests.urlretrieve

i am trying to download a .torrent file from a password protected site. I have managed to get to the site using cookies like so: cookies = {'uid': '232323', 'pass': '31321231jh12j3hj213hj213hk', '__cfduid':…
Nanoni
  • 451
  • 2
  • 7
  • 20
1
vote
2 answers

urllib.request.urlretrieve leads to an urlopen error [WinError 10060]

I try to download a tgz file from an url. If I use the link and copy it to Firefox, a download-as dialog occures and I can download the data. If I use this code, I get an urlopen error: urllib.request.urlretrieve(HOUSING_URL,…
Jan021981
  • 521
  • 3
  • 28
1
vote
0 answers

urlopen fails with getaddrinfo error

I deleted my python 2.7 and installed the new 3.X version(conda). Then the urlopen just did not work. from urllib.request import urlopen html = urlopen("http://www.google.com/") returns URLError: urlopen error [Errno 10093] getaddrinfo failed.…
baozi
  • 679
  • 10
  • 30
1
vote
1 answer

close the ftp connection after using urlretrieve

from six.moves.urllib.request import urlopen, urlretrieve urlretrieve('ftp://ftp.cdc.noaa.gov/Datasets/ncep.reanalysis.dailyavgs/surface/air.sig995.1949.nc', filename='C:\\desktop\\') Do I need to close the ftp connection after using…
user308827
  • 21,227
  • 87
  • 254
  • 417
0
votes
0 answers

404 Not Found when use request.urlretrieve

I get some response from external service. Then need to get url from this response and by this url download a file. When i pass url to urlretrieve from response.text, urlretrieve return an Error. But when i manually copy the url. Then set variable…
MR.Max
  • 36
  • 4
0
votes
1 answer

How Can You Read Image Files from a URL and display it in Google Colab?

Using Google Colab, I would like to be able to read in some number of image files each of which is at a different url and then display each of them. I got the following code to work but it only displays the first image (no output for the 2nd or…
0
votes
1 answer

urllib: specifying download path makes url invalid

I am trying to write a function that takes a url and a path and downloads a file to that path IF it's a text file. import urllib import re import os mcBethURL = 'https://ia802707.us.archive.org/1/items/macbeth02264gut/0ws3410.txt' def …
user20693776
0
votes
1 answer

Whatsapp cloud API can not retrieve media file

I am looking for the documentation "https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#example-4" Both tested with postman and curl but instead of audio file I am getting HTML response, saying "sorry, something went wrong" I was…
0
votes
2 answers

urlretrieve is really slow in my programm to download image from a specific website

I'm using urlretrieve from the urllib.request library to download images from a website. My code is slow af. it took 12 min to save 4 images (64x64 and png). This isn't normal as i've tested it on other sites and it works way faster (i mean 3…
Max
  • 1
0
votes
1 answer

I want to designate folder to store google images

urllib.request.urlretrieve(imgUrl, image_name + "_" + str(count+1) + ".jpg") google images are always saved the same folder as where source code is every time I want to change folders to save them import os import tkinter.ttk as ttk import…
0
votes
1 answer

Pass a file from a PHP server to a Python server (HTTP request)

I have a web application running on a Laravel PHP server. For some needs (Word document processing), I implemented a Python server that does data extraction. I would like to know how to call my Python server from PHP by passing a file to…
Snakies
  • 3
  • 1
0
votes
1 answer

multiple image downloader using CSV file and python

I am facing an error with this code. Can anyone help me with it so I can automate the process of downloading all the images in the CSV file that contain all the URLs of the images? The error I am getting is: URLError …
dxbforce
  • 3
  • 1
0
votes
2 answers

urllib urlretrieve only saving final image in list of urls

I'm fairly new to using Python. I have been trying to set up a very basic web scraper to help speed up my workday, it is supposed to download images from a section of a website and save them. I have a list of urls and I am trying to use…
badger
  • 3
  • 2