<jupyter_start><jupyter_text>Scraping Google Imagessimple_image_download, imported here as "simp" will scrape the first N (no_images) images displayed for a search term.  Here the search term is looped over from a list of house plants in a .csv<jupyter_code>from simple_image_download import simple_image_download as simp
import pandas as pd
import os
plants_df = pd.read_csv('../data/house_plants.csv', names=['name','type'], skiprows=1,) # load plants list
no_images = 2000 # number of images to download for each search

response = simp.simple_image_download # initialize downloader
# download houseplants
for plant in plants_df.name.values:
    response().download(f'{plant} houseplant', no_images)
os.makedirs('../google_images/', exist_ok=True) # create google images directory (this will overwrite)

# rename to remove spaces
for plant in plants_df.name.values:    
    os.system(f'mv -r ../simple_images/{plant}_plant/ ../google_images/{plant}')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09867751780264497, 'fraction_numerical': 0.00508646998982706, 'mean_word_length': 5.516556291390729, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '171935', 'license': 'MIT', 'n_tokens_mistral': 309, 'n_tokens_neox': 293, 'n_words': 97, 'path': 'notebooks/01_scrape_google_images.ipynb', 'repo_name': 'Amey-D/PlantPal', 'size': '983'}