from selenium import webdriver
# from selenium.webdriver.chrome.options import Options
from time import sleep
from selenium.webdriver import ActionChains
# from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.wait import WebDriverWait
# chrome_options = Options()
# chrome_options.add_argument('--headless')
# chrome_options.add_argument('--disable-gpu')
# chrome_options.add_argument('-kiosk')
class Auto_Brush():
bro = webdriver.Chrome(executable_path="chromedriver.exe")
bro.maximize_window()
bro.implicitly_wait(10)
title = None
js = "document.getElementsByClassName('controlsBar')[0].style.display='block'"
def login(self, password, username):
# url = "https://www.zhihuishu.com/"
self.bro.get(url)
try:
self.bro.find_element_by_xpath('//*[@id="notLogin"]/span/a[1]').click()
# username
self.bro.find_element_by_xpath('//*[@id="lUsername"]').send_keys(username)
# password
self.bro.find_element_by_xpath('//*[@id="lPassword"]').send_keys(password)
# con