google images reverse search code example
Example 1: search google images python
from selenium import webdriver
from bs4 import BeautifulSoup
import requests
import urllib.request
import time
import sys
import os
print("What do you want to download?")
download = input()
site = 'https://www.google.com/search?tbm=isch&q='+download
driver = webdriver.Firefox(executable_path = 'C:\Drivers\geckodriver.exe')
driver.get(site)
i = 0
while i<7:
driver.execute_script("window.scrollBy(0,document.body.scrollHeight)")
try:
driver.find_element_by_xpath("/html/body/div[2]/c-wiz/div[3]/div[1]/div/div/div/div/div[5]/input").click()
except Exception as e:
pass
time.sleep(5)
i+=1
soup = BeautifulSoup(driver.page_source, 'html.parser')
driver.close()
img_tags = soup.find_all("img", class_="rg_i")
count = 0
for i in img_tags:
try:
urllib.request.urlretrieve(i['src'], str(count)+".jpg")
count+=1
print("Number of images downloaded = "+str(count),end='\r')
except Exception as e:
pass
Example 2: images
/** High resolution open source images stocks**/
https://unsplash.com/images/stock/high-resolution
https://www.pexels.com/search/high%20resolution/
https://www.stockphotosecrets.com/questions-answers/technical/how-can-i-get-a-higher-resolution-of-an-image.html
https://www.shutterstock.com/search/high+resolution
https://gratisography.com/
https://www.techsmith.com/blog/what-is-hi-res/
https://burst.shopify.com/
https://pixabay.com/images/search/high%20resolution/
https://www.powtoon.com/blog/11-free-image-resources-presentation/
https://www.stockfreeimages.com/p1/cartoon.html
https://99designs.ca/blog/resources/public-domain-image-resources/
https://www.istockphoto.com/illustrations/naruto?mediatype=illustration&phrase=naruto&sort=mostpopular
https://www.freepik.com/search?dates=any&format=search&page=1&query=naruto&sort=popular
https://mashable.com/2017/05/23/where-to-find-royalty-free-images/