from selenium import webdriver
class WebDriverChrome(object):
def __init__(self):
self.driver = self.StartWebdriver()
def StartWebdriver(self):
options = webdriver.ChromeOptions()
options.add_argument("start-maximized")
options.add_argument("--disable-blink-features=AutomationControlled")
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option("useAutomationExtension", False)
driver = webdriver.Chrome(options=options)
return driver
def RunStart(self):
self.driver.get('https://bot.sannysoft.com')
# self.driver.quit()
if __name__ == '__main__':
Crawl = WebDriverChrome()
Crawl.RunStart()
来自:https://blog.csdn.net/weixin_38640052/article/details/113421737
网友评论