Google使用POST请求进行反向图片搜索

Google使用POST请求进行反向图片搜索,第1张

Google使用POST请求进行反向图片搜索

如果您愿意安装请求模块,这很容易做到。反向图像搜索工作流程当前由单个POST请求组成,该请求具有对上载URL的多部分主体,对此的响应是重定向到实际结果页面。

import requestsimport webbrowserfilePath = '/mnt/Images/test.png'searchUrl = 'http://www.google.hr/searchbyimage/upload'multipart = {'enpred_image': (filePath, open(filePath, 'rb')), 'image_content': ''}response = requests.post(searchUrl, files=multipart, allow_redirects=False)fetchUrl = response.headers['Location']webbrowser.open(fetchUrl)

当然,请记住,Google可能会决定随时更改此工作流程!



欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5508354.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-13
下一篇 2022-12-13

发表评论

登录后才能评论

评论列表(0条)

保存