def _login(driver, user, psw): mgtv = Base(driver) driver.get("https://www.youku.com") mgtv.click(loc_to_user_login_path) mgtv.send_words(loc_to_user_inputbox, user) mgtv.send_words(loc_to_psw_inputbox, psw) mgtv.click(loc_to_agree) mgtv.click(loc_to_login_btn)
def _login(driver,username="******",psw="Qaz123456!"): base = Base(driver) # driver.get(host) ## 在这边在写一次打开网址,会导致运行脚本时多次打开空白网页 base.send_words(loc_userName,username) base.send_words(loc_psw,psw) base.click(loc_submit_btn)