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

[((9, 7, 9, 24), 'requests.get', 'requests.get', ({(9, 20, 9, 23): 'url'}, {}), '(url)', False, 'import requests\n'), ((10, 7, 10, 35), 'bs4.BeautifulSoup', 'bs', ({(10, 10, 10, 19): 'page.text', (10, 21, 10, 34): '"""html.parser"""'}, {}), "(page.text, 'html.parser')", True, 'from bs4 import BeautifulSoup as bs\n'), ((20, 0, 20, 16), 'os.chdir', 'os.chdir', ({(20, 9, 20, 15): '"""imgs"""'}, {}), "('imgs')", False, 'import os\n'), ((16, 7, 16, 29), 'os.path.exists', 'os.path.exists', ({(16, 22, 16, 28): '"""imgs"""'}, {}), "('imgs')", False, 'import os\n'), ((17, 2, 17, 21), 'os.makedirs', 'os.makedirs', ({(17, 14, 17, 20): '"""imgs"""'}, {}), "('imgs')", False, 'import os\n'), ((28, 13, 28, 30), 'requests.get', 'requests.get', ({(28, 26, 28, 29): 'url'}, {}), '(url)', False, 'import requests\n'), ((31, 20, 31, 37), 'requests.get', 'requests.get', ({(31, 33, 31, 36): 'url'}, {}), '(url)', False, 'import requests\n')]