栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

Selenium浏览器指纹模拟

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Selenium浏览器指纹模拟

代码适合python+selenium+webdriver来实现chrome的指纹模拟,需要的自取,也欢迎你和我分享你的实现方式

用driver.execute_cdp_cmd执行JS代码即可实现Selenium浏览器指纹的模拟(以下代码插入到driver.start()之前)

Canvas指纹:

driver.execute_cdp_cmd("Page.addscriptToevaluateOnNewdocument", {"source": """const toBlob=HTMLCanvasElement.prototype.toBlob;const toDataURL=HTMLCanvasElement.prototype.toDataURL;const getImageData=CanvasRenderingContext2D.prototype.getImageData;function noisify(canvas,context){if(context){const shift={'r':Math.floor(Math.random()*10)-5,'g':Math.floor(Math.random()*10)-5,'b':Math.floor(Math.random()*10)-5,'a':Math.floor(Math.random()*10)-5};const width=canvas.width;const height=canvas.height;if(width&&height){const imageData=getImageData.apply(context,[0,0,width,height]);for(let i=0;i 

Webgl指纹:

driver.execute_cdp_cmd("Page.addscriptToevaluateOnNewdocument", {"source": """var config={"random":{"value":function(){return Math.random()},"item":function(e){var rand=e.length*config.random.value();return e[Math.floor(rand)]},"number":function(power){var tmp=[];for(var i=0;i 

Css字体指纹:

driver.execute_cdp_cmd("Page.addscriptToevaluateOnNewdocument", {"source": """var rand={"noise":function(){var SIGN=Math.random() 

音频指纹:

目前暂未找到合适的方案,如果你知道请和我分享,后续有合适的将及时更新

Canvas字体指纹:

目前暂未找到合适的方案,如果你知道请和我分享,后续有合适的将及时更新

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/342095.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号