urlretrieve function of urllib module in python

Using the urllib module in python can complete common crawler programs, and use urlretrieve to capture a file


For example, in python3, you can use

import urllib

urllib.request.ulrretrieve(url, filename)

Among them, url indicates the file link to be crawled, and filename indicates the name of the file saved to the local


But in python2.7, it is different

import urlib

urllib.urlretrieve(url, filename)
There is no request, otherwise an error will be reported, indicating that urllib.request cannot be found
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325754020&siteId=291194637