当前位置: 首页 > news >正文

php wordpress 等优化搜索引擎的方法

php wordpress 等,优化搜索引擎的方法,wordpress伪静态不现实,定制企业网站多少钱背景 最近在使用selenium自动播放学习课程,相信大家也有一些类似的使用场景。 能自动化的事情,绝不自己干。 为防止被检测是机器人做题,刷视频,需要做一些小调整。 先来看作为服务方维护者,是如何检测是Selenium打…

背景

最近在使用selenium自动播放学习课程,相信大家也有一些类似的使用场景。

能自动化的事情,绝不自己干。

为防止被检测是机器人做题,刷视频,需要做一些小调整。

先来看作为服务方维护者,是如何检测是Selenium打开的浏览器,而非一般的活跃用户打开的浏览器。

测试环境

本文的测试环境如下:

Google Chrome 浏览器版本:版本 125.0.6422.77(正式版本) (64 位)

ChromeDriver版本:Chrome for Testing availability

如何检测是否是Selenium打开的浏览器页面

window.navigator.webdriver

直接的方式就是检测navigator的值。如果是selenium打开的web浏览器,则此值为true,或者为false,捉着undefined

 Selenium Page缓存

selenium自身再页面上的缓存有如下特征。

 可以用如下代码检测

function getPageCache(opt_doc) {var doc = opt_doc || document;var key = '$cdc_asdjflasutopfhvcZLmcfl_';
//  var key = 'doggie_';if (!(key in doc))doc[key] = new Cache();return doc[key];
}

如下是一些自动化测试常有的特征检测

runBotDetection = function () {var documentDetectionKeys = ["__webdriver_evaluate","__selenium_evaluate","__webdriver_script_function","__webdriver_script_func","__webdriver_script_fn","__fxdriver_evaluate","__driver_unwrapped","__webdriver_unwrapped","__driver_evaluate","__selenium_unwrapped","__fxdriver_unwrapped",];var windowDetectionKeys = ["_phantom","__nightmare","_selenium","callPhantom","callSelenium","_Selenium_IDE_Recorder",];for (const windowDetectionKey in windowDetectionKeys) {const windowDetectionKeyValue = windowDetectionKeys[windowDetectionKey];if (window[windowDetectionKeyValue]) {return true;}};for (const documentDetectionKey in documentDetectionKeys) {const documentDetectionKeyValue = documentDetectionKeys[documentDetectionKey];if (window['document'][documentDetectionKeyValue]) {return true;}};for (const documentKey in window['document']) {if (documentKey.match(/\$[a-z]dc_/) && window['document'][documentKey]['cache_']) {return true;}}if (window['external'] && window['external'].toString() && (window['external'].toString()['indexOf']('Sequentum') != -1)) return true;if (window['document']['documentElement']['getAttribute']('selenium')) return true;if (window['document']['documentElement']['getAttribute']('webdriver')) return true;if (window['document']['documentElement']['getAttribute']('driver')) return true;return false;
};

去除Selenium特征

去除window.navigator.webdriver

ChromeOptions options = new ChromeOptions();
options.addArguments("--remote-allow-origins=*");
// 移除chrome selenium 特征,window.navigator.webdriver
// chrome 125
options.addArguments("--disable-blink-features=AutomationControlled");
// 关闭界面上的---Chrome正在受到自动软件的控制
options.addArguments("disable-infobars");
WebDriver driver = new ChromeDriver(options);
// 再去打开页面
// driver.get("https://xxxxx.xx.xx.xx")

修改ChromeDriver特征

修改ChromeDriver特征,要么修改源码,再重新编译,要么直接修改二进制代码。本文选择直接修改二进制代码的方式,比较简单。

下载VIM

download : vim online

修改ChromeDriver可执行文件内容,修改之前记得备份下chromedriver.exe

vim.exe chromedriver.exe

将cdc_开头的都替换成你想要的,比如这边我是替换成了doggie 

替换完成保存

%s/cdc_/doggie_/g

当然还有一些伪装自己是活人的办法:

不再深入,后续有机会再玩。

参考文档

https://www.zenrows.com/blog/selenium-avoid-bot-detection#remove-javascript-signiture

https://datadome.co/threat-research/detecting-selenium-chrome/

http://www.mnyf.cn/news/580.html

相关文章:

  • 山东住房和城乡建设厅网站电话公司网站免费建站
  • 在家做网站建设网站广告调词软件
  • seo网站推广助理优化网站seo公司
  • 做网站流量怎么赚钱吗昆明百度推广开户费用
  • 怎么做免费的产品图片网站市场调研报告1000字
  • 商汇通网站长沙网络推广平台
  • 医院网站规划方案石家庄网站建设seo
  • 制作简易网站模板沧州网站建设公司
  • 广东网站制作公司游戏推广员上班靠谱吗
  • 做网站前期了解客户什么需求百度推广入口官网
  • 用手机建立网站百度客服电话24小时客服电话
  • 网站开发公司杭州网站建设上海网络推广公司
  • html做网站的原则外链推广软件
  • 个人网站制作模板图片百度客户服务中心
  • 极速网站建设公司电话seo优化轻松seo优化排名
  • 网站建设推广优化招聘模板win7优化教程
  • 做爰网站爱情岛优化网站的步骤
  • 别人冒用我们公司做的网站怎么关掉营销案例网站
  • 广西网站建设公司哪家好靠谱的seo收费
  • 建设论坛网站用什么cms徐汇网站建设
  • 建设商城网站公司 百度百科搜索引擎优化分析报告
  • 科技网站建设信息流广告投放流程
  • 46设计网站官网灰色关键词排名代做
  • Wordpress老是给攻击seo描述是什么
  • b战网站建设策划书企业品牌推广网站
  • 做挂的网站百度官网地址
  • 外包做网站公司有哪些怎么把产品快速宣传并推广
  • 微信小程序开发教程从零开始seo排名优化价格
  • 掘金网站建设搜索引擎seo如何赚钱
  • ps做网站学到什么程度什么是seo和sem