python每日定时任务签到

想在fishc上面下个课件,可惜币不够,会员又太贵,我还发现签到每天时间越找币给的越多,于是就有了这篇文章
请自行修改账号密码

from selenium.webdriver import Chrome
from datetime import datetime
import os,time
from selenium.webdriver.chrome.options import Options
from apscheduler.schedulers.blocking import BlockingScheduler

def trick_not_chromedriver():
    option = Options()
    option.add_argument('--disable-blink-features=AutomationControlled')
    return option
def tick():
    web = Chrome(options=trick_not_chromedriver())
    web.get('https://fishc.com.cn/plugin.php?id=k_misign:sign')
    time.sleep(2)
    web.find_element_by_xpath('//*[@id="ls_username"]').send_keys('账号')
    web.find_element_by_xpath('//*[@id="ls_password"]').send_keys('密码')
    web.find_element_by_xpath('//*[@id="lsform"]/div/div/table/tbody/tr[2]/td[3]/button/em').click()
    web.find_element_by_xpath('//*[@id="wp"]/div[2]/div[1]/div[1]/span').click()
    print('Tick! The time is: %s' % datetime.now())
    time.sleep(2)

if __name__ == '__main__':
    scheduler = BlockingScheduler()
    scheduler.add_job(tick, 'cron', hour=0,minute=1)
    print('Press Ctrl+{0} to exit'.format('Tab' if os.name == 'nt' else 'C    '))
    # print('Tick! The time is: %s' % datetime.now())
    try:
        scheduler.start()
    except (KeyboardInterrupt, SystemExit):
        pass

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值