教你如何用python+selenium自动刷新csdn访问量

image description

教你如何用python+selenium自动刷新csdn访问量

写在最前面

鉴于我的博客访问量少的可怜,本人比较懒又不高兴每天点开自己手动刷访问量,于是结合selenium搞了个自动的程序每天刷点访问量,赚点积分。

代码

from selenium import webdriver
import time
import threading


def mycsdn():
    driver = webdriver.Chrome()
    i = 'https://blog.csdn.net/ssjdoudou/article/details/'
    j = ['83987504','83545438','84023801','84036156','83934801','83934801','83931392','83927099','83901600','83869532']
    js = 'window.open("https://blog.csdn.net/ssjdoudou");'
    driver.execute_script(js)
    for k in range(10):
        s = i + j[k]
        #print('window.open("{url}");'.format(url=s))
        driver.execute_script('window.open("{url}");'.format(url=s))
        time.sleep(2)
    driver.quit()


def mytime():
    while 1:
        mycsdn()
        time.sleep(200)


if __name__ == "__main__":
    t = threading.Thread(target=mytime())
    t.start()
    ArithmeticJia         7         375         Python         16    

David Ramon

ArithmeticJia

www.guanacossj.com

Life is Short,You need Python

Related Posts

You may like these post too

image description

python中的GIL锁

为什么我们说python中无法实现真正的多线程呢,这是因为在C语言写的python解释器中存在全局解释器锁,由于全局解释器锁的存在,在同一时间内,python解释器只能运行一个线程的代码,这大大影响了python多线程的性能。而这个解释器锁由于历史原因,现在几乎无法消除。 python GIL

image description

python多进程和进程池

##写在最前面: linux下可使用 fork 函数 通常使用 multiprocessing更常见 我们分别使用单进程和多进程处理run函数 ```python import time,os from multiprocessing import P

Comments on this post

7 comments

image description

ArithmeticJia

徐萌萌哒

REPLY
image description

ArithmeticJia

hhh

image description

ArithmeticJia

hhh

image description

admin

bbb

Leave a comment

it’s easy to post a comment

image description
image description
image description
image description
image description
image description
image description
image description
image description

Copyright © 2019.Company name All rights reserved.苏ICP备19007197号