There was a response to a question on image reverse search that had this code. I can get it to work however when I look at the response it isn't helpful. I've tried response.text/json but it just shows the returned url. It produces the url regardless of if the image exists on google so isn't too meaningful.
How do I extract meaningful information from the response?
import requests
import webbrowser
filePath = '/mnt/Images/test.png'
searchUrl = 'http://www.google.hr/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)
Question this response was provided: Google reverse image search using POST request