# Check fastbook is installed
!pip install fastbook
# Import fastbook functions, in our case we'll be using: search_images_ddg
from fastbook import *
# create a function that will take an arbitrary search term and return a list of urls.
def search_images(term, max=30):
print(f"Searching for '{term}'")
# search_images_ddg comes from fastbook: https://github.com/fastai/fastbook/blob/master/utils.py#L45
return search_images_ddg(term, max_images=max)
urls = search_images("cats eating ice cream")
14 Likes