前言:為了應對青軟網課簽到。
準備:python環境,selenium庫 pip stall selenium即可。
**:
from time import sleep
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.common.by import by
from selenium.webdriver.support.wait import webdriverwait
from selenium import webdriver
driver = webdriver.chrome()
locator = (by.class_name, "vhall-signinbox")
def signin():
driver.get("")
# 當頁面開啟後留出時間登入
sleep(60)
while 1:
print("又開始新一輪等待")
# 等待元素出現,等待時間越長越好
webdriverwait(driver, 360000).until(ec.presence_of_element_located(locator))
if driver.find_element_by_class_name("vhall-signinbox") is not none:
print("簽到成功")
driver.find_element_by_xpath("//*[@id=\"vhall-saas-watchbox\"]/div[3]/div/div[2]/p[2]/button").click()
if __name__ == '__main__':
signin()
python對接微吼
class accountsync object def init self 微吼 self.auth type 1 授權型別,1為驗證帳號和密碼 目前只通過帳號和密碼驗證 self.account auth type為1時為必填項,用於登入e.vhall.com的帳號,是在 帳號設定 頁面裡查詢到...
貼吧自動簽到
tieba sign.php date default timezone set prc set time limit 0 echo date y m d h i s r n 身份標識 bduss 定義自定義函式 function xcurl url,cookie null,postdata nul...
Python自動簽到打卡
通過 selenium 框架來實現自動打卡 導庫 usr bin env python3 coding utf 8 software pycharm virtualenv workon contact 1040691703 qq.com desc code descripton author 未昔 ...