Created
August 6, 2019 19:12
-
-
Save juque/7c1143fcee6f891bc89646349a71a4e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from bs4 import BeautifulSoup | |
| import os | |
| import urllib.request | |
| file = open("t.tmp") | |
| content = file.read() | |
| soup = BeautifulSoup(content,'html.parser') | |
| print(soup) | |
| a = soup.find_all('a') | |
| for i in a: | |
| name = os.path.basename(i.get('href')).replace("Logo+","").replace("+","_").lower() | |
| url = i.get('href') | |
| print("Descargado {}".format(url)) | |
| urllib.request.urlretrieve(url,name) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment