遇到屏蔽selenium的站点如何突破

访问某团外卖,查看下一页商家信息,正常浏览器可以打开, selenium打开就404, 

分析请求参数,生成方法最后定位到 rohr*.js  有判断selenium特征

 

代理 mitmproxy , 替换成本地js

def response(flow:mitmproxy.http.HTTPFlow):
    try:
        url = flow.request.url
        if url == "http://s0.meituan.net/mx/rohr/rohr.min.js":
            global local_js
            if local_js is None:
                with open("rohr.local.js", "rb") as js:
                    local_js = js.read()
            flow.response.content = local_js
    except:
        return

我去去去

selenium在运行的时候会暴露的Javascript特征字符串:

window.navigator.webdriver
webdriver
__driver_evaluate
__webdriver_evaluate
__selenium_evaluate
__fxdriver_evaluate
__driver_unwrapped
__webdriver_unwrapped
__selenium_unwrapped
__fxdriver_unwrapped
_Selenium_IDE_Recorder
_selenium
calledSelenium
_WEBDRIVER_ELEM_CACHE
ChromeDriverw
driver-evaluate
webdriver-evaluate
selenium-evaluate
webdriverCommand
webdriver-evaluate-response
__webdriverFunc
__webdriver_script_fn
__$webdriverAsyncExecutor
__lastWatirAlert
__lastWatirConfirm
__lastWatirPrompt
$chrome_asyncScriptInfo
$cdc_asdjflasutopfhvcZLmcfl_

posted @ 2019-09-23 16:47  1553  阅读(2487)  评论(0编辑  收藏  举报