From 2fcbf465cd0d8cbdf6ee1960bb90c98ac1c75287 Mon Sep 17 00:00:00 2001 From: luyishisi <543429245@qq.com> Date: Wed, 15 Feb 2017 16:51:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0as-rank=E7=BD=91=E7=AB=99?= =?UTF-8?q?=E7=9A=84=E9=87=87=E9=9B=86-=E5=AD=98=E4=B8=BA=E6=88=AA?= =?UTF-8?q?=E5=9B=BE=E5=92=8C=E6=BA=90=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 10244 -> 10244 bytes 10.selenium/as-rank/ghostdriver.log | Bin 0 -> 25102 bytes 10.selenium/as-rank/selenium_so_phamtomjs.py | 46 +++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 10.selenium/as-rank/ghostdriver.log create mode 100644 10.selenium/as-rank/selenium_so_phamtomjs.py diff --git a/.DS_Store b/.DS_Store index 4ba735dd93914b0e562b166568063fafdbc3c51c..82ee74511c87ed60ac09f76abc2546c328c9f57e 100644 GIT binary patch delta 42 ycmZn(XbG6$&uFZ735?VmlzmaXJle#VP#|I;N;}sOa|;+4 z>Vb+>6ffgenw#(9l2Tfd%)oG^Zq`Y#**FZ%%}*gxWkCkadIot0231f%<8tX{9l@78 Po7ok9v25lSW@ZKeKj30M diff --git a/10.selenium/as-rank/ghostdriver.log b/10.selenium/as-rank/ghostdriver.log new file mode 100644 index 0000000000000000000000000000000000000000..52c3b38acc3adcc23d4c695db693c4a52c5ca2e7 GIT binary patch literal 25102 zcmeI5ZByem5XbwPPoc@1z#MUGCw3C|70uCuy8<0T%T1Y^j%;rdgChAP87^h+yLX+K z!12&IXy}BpydjY+dH1(}J$OB%ob2xZe856ME=(=5y10G8K@Rf4`bF3ChC=alcY?Mox)Lhk;z%9BL|OPv zi>)L<-xkd(iwXmJYXs8PqS~JND-(h@1IK0SdpyacRc8Dn+m#jsl1(E!qn6^df6E;KI{V73Hkivp{(lXA;rZeYY6!ueuvS96q4R$al9@tx)s8f+~gDf_wIL1N4R1lB2it>?L+rK+$P$HDDJTG`TE zfw(I(ISz>24vgr3k};vJir0hDl`^mrTW{NQSM$ITr=u#EH0`s-&18Q)dKrTR{2o zr|E9GULSMw9;ZbV9Zrk&4aeB2fcnPT8e@xL5jC4vif$%K8YSS(8|TzSe%N9-;X`TH zf8n^XJUNTdv~@0(oK93>*szc@nQpN4v9&qc%1uLadFCWMOSz-;sF@crYQA|jGE8ZE z=q=O9R^$dwyZ!Vv?4?F`iH@&wba9<+2f?cwyRB$xj<0TX+vRT7YrnqeR*r{Dko77@ z7uQ{{TRy8i?djsB&dlv-=J+yXy}Hp2A{Td6{xY0=S-Yyr@nvi$S2?;t+i_pvx*J3@ z$N%5a4I>|)vHwNh=cUffOLTm7$8H$4drq(Gy}EU`a(o$&f-4Z+2XeNZc?S5#*70s` zB@w`7kAsWcdicD4(@x6nU9?Fu>4#JxgEg9~?iJUg$(# z&+)zPtJB#M9bZ|U`PG|-8~eLw*V+Awzp~`UlKePJ-eS%avxrw>XZ7#NCe}Au3<<~A z1ngq=s-hf5Yd_E*5g-CYfCvx)B0vO)01+SpM1Tko0U|&IhyW2F0z`la5CI}U1c(3; zAOb{y2oM1xKm>>Y5g-CYfCvx)B0vO)01+SpM1Tko0U|&IhyW2F0z`la5CI}U1c(3; zAOb{y2oM1xKm>>Y5g-CYfCvzQ7fs-ypCo8SJ|3FiYh52I^|-@+o^ZU?{l^Y@l_fWh oFMXUPca9xub$B}tgV`@D1XsVTz|)4C`fU$-Lmv0|{l^ad4ZsLwSpWb4 literal 0 HcmV?d00001 diff --git a/10.selenium/as-rank/selenium_so_phamtomjs.py b/10.selenium/as-rank/selenium_so_phamtomjs.py new file mode 100644 index 00000000..0f4e7ce1 --- /dev/null +++ b/10.selenium/as-rank/selenium_so_phamtomjs.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python +# -*- coding: UTF-8 -*- +#------------------------------------------------------------------------- +# 程序:selenium_so.py +# 版本:0.1 +# 作者:ly +# 日期:编写日期2016/11/23 +# 语言:Python 2.7.x +# 操作:python selenuium.py +# 功能:结合crontab定时启动每天自动登录so网站,刷银牌用 +#------------------------------------------------------------------------- + +from selenium import webdriver +from selenium.webdriver.common.keys import Keys +import time,sys + +# 中文编码设置 +reload(sys) +sys.setdefaultencoding('utf-8') +Type = sys.getfilesystemencoding() + +#加载内核 +driver = webdriver.PhantomJS() + +#发起请求≈ +for i in range(10,20): + try: + print i,'begin',time.ctime() + num = i + url = 'http://as-rank.caida.org/?mode0=as-info&mode1=as-table&as='+str(num)+'&data-selected-id=39' + driver.implicitly_wait(10) + driver.get(url) + #保存页面截图和源码 + name = './png/'+str(num)+'.png' + name_html = "./code/"+str(num)+'.html' + + driver.save_screenshot(name) + f = open(name_html,'w') + f.write(driver.page_source) + f.close() + + #time.sleep(5) + print i,'end ',time.ctime() + except Exception,e: + print e +driver.close()