python小爬蟲SendKey自動刷博刷視頻外掛

來源:互聯網
上載者:User

python小爬蟲SendKey自動刷博刷視頻SendKeys簡介

sendkeys是python的一個擴充包,其中有一些常用的符號來表示鍵盤的快速鍵或者輸入的字元,對於pywinauto來說,非常的實用。使用SendKeys將鍵擊和按鍵組合擊發送到活動應用程式。

Sendkeys常用的按鍵鍵碼

按鍵 鍵碼 sendkeys使用方式
Shift + {"+"}
tab TAB {“TAB”}
ctrl ^ {"^"}
alt % {"%"}
f1~fn F1 ~ Fn {"F1"} ~ {"Fn"}
向上鍵 UP {"UP"}
向下鍵 DOWN {"DOWN"}
斷行符號 ENTER {"ENTER"}
Num鍵 NUM LOCK {“NUMLOCK”}

Sendkeys下載與安裝

下載

安裝windows版.exe可以直接雙擊安裝即可。Sendkeys常式
#coding:utf-8import webbrowser as webimport SendKeysimport time# 開三個網頁url1 = "http://blog.sina.com.cn/s/blog_46d7df020102dvfz.html"web.open_new_tab(url1)url2 = "http://www.jeapedu.com"web.open_new_tab(url2)url3 = "http://www.chinagame.me"web.open_new_tab(url3)i = 0while i < 10:    time.sleep(1)    # 發送 Ctrl + F5  重新整理    SendKeys.SendKeys("^{F5}")    # 延時5 s    time.sleep(5)    # 切換網頁    SendKeys.SendKeys("^+{TAB}")                time.sleep(1)        SendKeys.SendKeys("^{F5}")    time.sleep(5)    SendKeys.SendKeys("^+{TAB}")                time.sleep(1)    SendKeys.SendKeys("^{F5}")    time.sleep(5)    SendKeys.SendKeys("^+{TAB}")                i += 1# 發送 Alt + F4SendKeys.SendKeys("%{F4}")        

特別提示:  此方法測在試刷 blog.csdn.net 部落格時失敗了,無效果!  csdn防爬蟲刷博的技術能力太強了!繼續研究爭取早日突破csdn的部落格

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.