get()后执行反反爬

This commit is contained in:
g1879 2021-02-05 21:02:52 +08:00
parent 1f3edb7dc7
commit bb9ec1c9ad

View File

@ -149,6 +149,11 @@ class DriverPage(object):
self._url = to_url
self._url_available = self._try_to_connect(to_url, times=retry, interval=interval, show_errmsg=show_errmsg)
try:
self._driver.execute_script('Object.defineProperty(navigator,"webdriver",{get:() => Chrome,});')
except:
pass
return self._url_available
def ele(self,