Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- from bs4 import BeautifulSoup as BS
- url = 'https://www.fifa.com/worldcup/teams/team/43938/'
- r = requests.get(url)
- soup = BS(r.text)
- number = 1
- for svg in soup.find_all('svg'):
- image = svg.find('image')
- if image:
- href = image['xlink:href']
- filename = '{}.jpg'.format(number)
- print('downloading:', number)
- r = requests.get(href)
- with open(filename, 'wb') as f:
- f.write(r.content)
- number += 1
Add Comment
Please, Sign In to add comment