织梦CMS - 轻松建站从此开始!

欧博ABG官网-欧博官方网址-会员登入

欧博娱乐Reverse search an image in Yandex Images using

时间:2025-08-27 13:35来源: 作者:admin 点击: 2 次
I'm interested in automatizing reverse image search. Yandex in particular is great for busting catfishes, even better than Google Images. So, consider

I'm interested in automatizing reverse image search. Yandex in particular is great for busting catfishes, even better than Google Images. So, consider this Python code:

import requests import webbrowser try: filePath = "C:\\path\\whateverThisIs.png" searchUrl = 'https://yandex.ru/images/' multipart = {'encoded_image': (filePath, open(filePath, 'rb')), 'image_content': ''} response = requests.post(searchUrl, files=multipart, allow_redirects=False) #fetchUrl = response.headers['Location'] print(response) print(dir(response)) print(response.content) input() except Exception as e: print(e) print(e.with_traceback) input()```

The script fails with KeyError, 'location' is not found. I know the code works cause if you substitute searchUrl with then the script returns the correct url. So, in short the expected outcome would be a url with an image search. In actuality we get a KeyError where that url was supposed to be stored. Evidently, Yandex doesn't work in exactly the same way, maybe the url is off (although I tried a heap ton of variations) or the reason may be completely different.

Regardless of that, help in solving this problem is much appreciated!

(责任编辑:)
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:
发布者资料
查看详细资料 发送留言 加为好友 用户等级: 注册时间:2025-08-28 16:08 最后登录:2025-08-28 16:08
栏目列表
推荐内容