A package to scrape Google Images for image relating to a picture or query
Project description
Google-Reverse-Image-Search
Installation
Download the main
folder (or just main/google_reverse_search.py
) into your local directory
Run the command in your local terminal (ideally also through a virtual environment - follow this guide https://docs.python.org/3/library/venv.html#creating-virtual-environments)
# assuming your virtual env has been set up
>> pip install -r requirements.txt
>> playwright install chromium
Note : Only works on Chrome (for now)
Usage
Import all functions from the file with
from google_reverse_search import *
Then start anywhere with the three basic functions
print(search_with_query(query="your query"))
print(search_with_url(url="https://link/to/photo"),num=5)
print(search_with_file(file_path="C:/path/to/file",num=20))
Examples
All three functions will return the images in a similar manner
Code
res:dict = search_with_query(query="boats",num=3)
print(res)
Results
Formatted for better viewing
Connected...
Navigating...
Getting results...
Formatting results...
{'title': 'boats',
'data': [
{'link': 'https://www.discoverboating.com/sites/default/files/small-boats_1.jpg', 'name': 'The Ultimate Guide to Small Boats | Discover Boating', 'dimensions': [1200, 795]},
{'link': 'https://d1nkxkz7ge96ao.cloudfront.net/eyJidWNrZXQiOiJzbW4tbWFpbi1zaXRlLWJ1Y2tldCIsImtleSI6ImltYWdlc1wvaW1hZ2luXC9McktPcmhFcE5FN0FNV3lFQUxRMUpFOE0wTjVsc1VkekxsNU9ZcEZsLmpwZyIsImVkaXRzIjp7InJlc2l6ZSI6eyJ3aWR0aCI6MjYwMCwiaGVpZ2h0IjoxMzAwLCJmaXQiOiJjb3ZlciJ9fX0=', 'name': "Family-Friendly Offshore Center Consoles & Bay Boats from 20' to 35' | Sportsman Boats", 'dimensions': [2600, 1300]},
{'link': 'https://cdn.britannica.com/27/166127-050-5E3F9372/salmon-fishing-boat-Alaska.jpg', 'name': 'Boat | Definition, History, Types, & Facts | Britannica', 'dimensions': [1600, 1075]}
]
}
Bugs and Issues
Please raise any issues you have on the Issues
forum, and I'll take a look (hopefully)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for google-reverse-image-search-0.3.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d108b25218e471141db3287134db185b4af23a84be006de058fa06199f5d87f5 |
|
MD5 | ae8bbd869cc0f60b1010e33ebaa9e831 |
|
BLAKE2b-256 | 257876e4dca9f434a1ce8a964452c1148e455532b4f111137cca205279bdad97 |
Close
Hashes for google_reverse_image_search-0.3.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6e1726bef2b80139c666e704d4a1ca71d7f6ddadc7d7ab9c5ddb11a4bf89c28 |
|
MD5 | 2700aab2e8ccbf596a922b0f1bd2969f |
|
BLAKE2b-256 | cefbabcf372fc72df1500feab4662d06e28a26b2d62f5cddbee2177775cca507 |