Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import webbrowser
- filePath = 'test.jpg'
- searchUrl = 'http://www.google.com/searchbyimage/upload'
- multipart = {'encoded_image': (filePath, open(filePath, 'rb')), 'image_content': ''}
- response = requests.post(searchUrl, files=multipart, allow_redirects=False)
- fetchUrl = response.headers['Location']
- webbrowser.open(fetchUrl)
Add Comment
Please, Sign In to add comment