批量判断流量大于300的小脚本

#!/usr/bin/env pytho 
#encoding:utf-8
#by i3ekr

import requests
from lxml import etree

can = []
quchongfu = []
aizhan = "https://www.aizhan.com/cha/"
with open('./url.txt') as f:
    with open("./ok.txt",'a') as ok:
        r_url = f.readlines()
        for i in r_url:
            url = i.strip("\n")
            if "https://" in url:
                url = url.replace("https://","")
            if "http://" in url:
                url = url.replace("http://","")
            spider_url = aizhan + url
            res_html = requests.get(spider_url).text
            selector = etree.HTML(res_html)
            content = selector.xpath('//*[@>)
            print u"网站:%s 流量:%s"%(url,content)
            #输出日IP大于300的网站
            content = "".join(content)#转换为字符串
            LiuLiang = content.split('~')[0]
            if "," in LiuLiang:
                LiuLiang = LiuLiang.replace(",","")
            if LiuLiang >= 100:
                can.append(url)
                ok.write(url+"\r\n")

for i in can:
    print "[+] %s"%(i)

 

相关文章:

  • 2022-12-23
  • 2021-05-29
  • 2021-09-21
  • 2021-10-31
  • 2021-05-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-18
  • 2021-12-01
  • 2021-12-10
  • 2021-12-23
  • 2022-12-23
相关资源
相似解决方案