乌云精华漏洞爬取匹配

  • A+
所属分类:Python

乌云精华漏洞爬取匹配乌云精华漏洞爬取匹配

# -*- coding:utf-8 -*-
import urllib
import urllib2
import re
import sys

reload(sys)

sys.setdefaultencoding('utf-8')
page=1
file_object=open('jinghua.txt','w')
while (page<4418):
    url="http://wooyun.org/bugs/page/"+str(page)
    try:
        request=urllib2.Request(url)
        response=urllib2.urlopen(request)
        #print response.read()
        content = response.read().decode('utf-8')
        pattern = re.compile('<td><a.*?href="(.*?)">(.*?)</a>(.*?)</td>',re.S)
        items = re.findall(pattern,content)
        for item in items:
            haveImg=re.search('credit.png',item[2])
            if haveImg:
                #print item[0]+"\t",item[1]
                file_object.write(item[0]+"\t"+item[1]+"\n")
    except urllib2.URLError,e:
        if hasattr(e,"code"):
            print e.code
        if hasattr(e,"reason"):
            print e.reason
    page=page+1
file_object.close()

View Code

  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的微信公众号
  • 我的微信公众号扫一扫
  • weinxin

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: