Skip to content

Instantly share code, notes, and snippets.

@erika-dike
Created June 28, 2017 09:29
Show Gist options
  • Save erika-dike/9cd967f044c0409b0a3a2c81c6eec212 to your computer and use it in GitHub Desktop.
Save erika-dike/9cd967f044c0409b0a3a2c81c6eec212 to your computer and use it in GitHub Desktop.
Auto download images from site
import os
def make_dir(dirname):
current_path = os.getcwd()
path = os.path.join(current_path, dirname)
if not os.path.exists(path):
os.makedirs(path)
if __name__ == '__main__':
driver = init_driver()
image_links = get_all_download_links(
driver, 'https://quotefancy.com/wallace-d-wattles-quotes')
time.sleep(5)
driver.quit()
dirname = 'imgs'
make_dir(dirname)
download_images('https://quotefancy.com', dirname, image_links)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment