import requests
from bs4 import BeautifulSoup as bs
import os

#source
url = '' # the source you want the bot take images from

#down page 
page = requests.get(url)
html = bs(page.text, 'html.parser')

#locate
image_loc = html.findAll('img')

#create folder for located imgs
if not os.path.exists('imgs'):
  os.makedirs('imgs')

#open the new folder
os.chdir('imgs')

image0 = 0 #img name

#get images
for image in image_loc:
  try:
    url = image['src']
    source = requests.get(url)
    if source.status_code == 200:
      with open('img-' + str(image0) + '.jpg', 'png') as mkimg:
        mkimg.write(requests.get(url).content)
        mkimg.close()
        image0 += 1
  except:
    pass

[((147, 164), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (159, 164), False, 'import requests\n'), ((172, 200), 'bs4.BeautifulSoup', 'bs', (['page.text', '"""html.parser"""'], {}), "(page.text, 'html.parser')\n", (174, 200), True, 'from bs4 import BeautifulSoup as bs\n'), ((350, 366), 'os.chdir', 'os.chdir', (['"""imgs"""'], {}), "('imgs')\n", (358, 366), False, 'import os\n'), ((282, 304), 'os.path.exists', 'os.path.exists', (['"""imgs"""'], {}), "('imgs')\n", (296, 304), False, 'import os\n'), ((308, 327), 'os.makedirs', 'os.makedirs', (['"""imgs"""'], {}), "('imgs')\n", (319, 327), False, 'import os\n'), ((469, 486), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (481, 486), False, 'import requests\n'), ((605, 622), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (617, 622), False, 'import requests\n')]