上一篇文章是在开发者模式下驱动浏览器,在网上也看到了不同的方法,我验证了下,在此附上。我看到的是添加mitmdump代理驱动浏览器。
技术参考来源:https://zhuanlan.zhihu.com/p/43581988
https://blog.csdn.net/hihell/article/details/88648151
如果想了解原理可以参考我附上的链接。
按照要求首先修改mitmdump源码
新建一个py文件indject_js_proxy.py
from mitmproxy import ctx
injected_javascript = '''
// overwrite the `languages` property to use a custom getter
Object.defineProperty(navigator, "languages", {
get: function() {
return ["zh-CN","zh","zh-TW","en-US","en"];
}
});
// Overwrite the `plugins` property to use a custom getter.
Object.defineProperty(navigator, 'plugins', {
get: () => [1, 2, 3, 4, 5],
});
// Pass the Webdriver test
Object.defineProperty(navigator, 'webdriver', {
get: () => false,
});
// Pass the Chrome Test.
// We can mock this in as much depth as we need for the test.
window.navigator.chrome = {
runtime: {},
// etc.
};
// Pass the Permissions Test.
const originalQuery = window.navigator.permissions.query;
window.navigato
使用selenium与mitmdump解决滑动验证码

本文介绍了如何结合selenium和mitmdump代理来处理滑动验证码。通过参考技术文章并修改mitmdump源码,创建了indject_js_proxy.py,然后使用selenium驱动浏览器验证代理的有效性。当访问特定网站时,结果全绿表示代理设置成功,为实现滑动滑块验证码的自动化奠定了基础。
最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



