Selenium定时刷新网页
代码
代码很简单,主要是为了熟悉Selenium
这个库的函数,为后续的短信轰炸做个铺垫
from selenium import webdriver import time import random url = raw_input('Input your website:').strip() num = int(raw_input('How much times do you want:'),10) options = webdriver.FirefoxOptions() options.add_argument('--headless') browser = webdriver.Firefox(firefox_options=options) browser.get(url) print 'Please wait...' for i in range(num): i += 1 print 'Refresh +%d' %i time.sleep(random.randint(1,3)) browser.refresh() browser.quit() print 'Good Bye!'
END
相关推荐
xiangxiaojun 2020-09-23
Reiki 2020-08-16
letheashura 2020-08-14
tiankele0 2020-07-29
curiousL 2020-07-18
王练 2020-07-18
tiankele0 2020-07-18
amei0 2020-07-08
Reiki 2020-07-06
Ronnyxie 2020-07-06
xiangxiaojun 2020-07-05
zhanghaibing00 2020-06-28
xiongyouqiang 2020-06-28
Ronnyxie 2020-06-27
amei0 2020-06-26
letheashura 2020-06-26
tiankele0 2020-06-26
王练 2020-06-25