Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # WEB SCRAPING 1
- from pathlib import Path
- root = "/content/drive/MyDrive/machinelearninginthecloud2022/exercise3/images_duckduckdgo/"
- from jmd_imagescraper.core import * # dont't worry, it's designed to work with import *
- duckduckgo_search(root, "reindeer", "reindeer photo", max_results=800)
- duckduckgo_search(root, "moose", "moose photo", max_results=800)
- # WEB SCRAPING 2
- !pip install bing-image-downloader
- .... then ....
- from bing_image_downloader import downloader
- downloader.download("reindeer",
- limit=200,
- output_dir='/content/drive/MyDrive/machinelearninginthecloud2022/exercise3/images_bing/reindeer',
- adult_filter_off=True,
- force_replace=False,
- timeout=120,
- verbose=True)
- downloader.download("moose",
- limit=200,
- output_dir='/content/drive/MyDrive/machinelearninginthecloud2022/exercise3/images_bing/moose',
- adult_filter_off=True,
- force_replace=False,
- timeout=120,
- verbose=True)
Advertisement
Add Comment
Please, Sign In to add comment