Example using Python to query and scrape Microsoft Bing image search.
BeautifulSoup and requests packages are required to run this example.
If you are using the command line and pip you should be able to install these with:
pip install bs4
pip install requests
To run, simply give the script an image search term. It will bing search for it and drop the discovered images into the Pictures subdirectory. In the following example we look for images of kittens.
python bing_image.py kitten
Actually it didn't worked for me and rather showed me an error as:
Traceback (most recent call last):
File "bing-image.py", line 30, in
mad = json.loads(a["mad"])
File "C:\ProgramData\Anaconda3\lib\site-packages\bs4\element.py", line 1321, in getitem
return self.attrs[key]
KeyError: 'mad'
Need some help to get over this.