menu

How to Use Selenium to Auto Login

  • date_range April 26, 2020 - Sunday info
    sort label
    selenium

使用Selenium自动化操作网页,以自动登陆(办公网)系统。

1. Selenium and ChromeDriver

» selenium调用chrome selenium操作chrome浏览器需要有ChromeDriver驱动来协助。

2. 开机自动启动

在/etc/rc.local文件中添加:

su - [username] -c [/absolute/path/to/your/script/to/auto/run]

3. 每12小时定时执行程序

» linux 定时执行任务 执行crontab -e命令,在弹出的文件中添加下面的代码:

* */12 * * * [/absolute/path/to/your/script/to/auto/run]

其中*/12表示每12小时执行一次。



KF

Comments