Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import requests as rq
import pandas as pd
from bs4 import BeautifulSoup
from tqdm import tqdm
page = rq.get('').content
soup = BeautifulSoup(page, 'xml')
df = pd.Series(list(map(lambda x: x.text, soup.findAll('image')))).to_frame('url')
df['title'] = pd.Series(list(map(lambda x: x.text.replace(' ', '').replace('!', '').replace(':', ''), soup.findAll('name'))))
for i, row in tqdm(list(df.iterrows())):
data = rq.get(row.url).content
with open('Downloads/{}.{}'.format(row.title, row.url.split('.')[-1]), 'wb') as fout:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.