Importing Data from the Web

Importing data from the web can be particularly useful whether it be images for machine learning or data from tables and so forth. Here is a list of methods for importing data from the web.

Importing Data from the Web Using Python 3

Scraping Content from Websites

Importing Images from Bing

def search_images_bing(key, term, max_images: int = 100, **kwargs):    
    params = {'q':term, 'count':max_images}
    headers = {"Ocp-Apim-Subscription-Key":key}
    search_url = "https://api.bing.microsoft.com/v7.0/images/search"
    response = requests.get(search_url, headers=headers, params=params)
    response.raise_for_status()
    search_results = response.json() 
   
    # returns an L object to be identical to the original function.
    return L(search_results['value'])

References

https://www.youtube.com/watch?v=0_VZ7NpVw1Y

https://stackoverflow.com/questions/64725234/fast-ai-seach-images-bing-throwing-permissiondenied-error

https://forums.fast.ai/t/getting-more-than-150-images-using-search-images-bing/77947/2

https://www.w3schools.com/python/module_requests.asp

https://www.crummy.com/software/BeautifulSoup/bs4/doc/