web安全的题,为了找key随手写的程序,无处安放,姑且贴上来。

 # -*- coding: UTF-8 -*-
__author__ = 'weimw' import requests
from BeautifulSoup import BeautifulSoup def request_ctf5():
f = open("out.txt", "w")
for i in range(1, 2000):
url = 'http://ctf5.simplexue.com/8/index.php?id=' + str(i)
res = requests.get(url)
res_table = BeautifulSoup(res.content).find('table')
tr_1 = res_table.findAll('tr')[0]
try:
tr_2 = res_table.findAll('tr')[1]
except:
print >> f, "no id and content"
continue
id_t = tr_2.findAll('td')[0].text
content_t = tr_2.findAll('td')[1].text
if id_t and content_t:
print >> f, "id = %s, content = %s" % (id_t, content_t)
return if __name__ == '__main__':
request_ctf5()

不断修改id访问URL2000次,分析返回的页面。

  

【安全】requests和BeautifulSoup小试牛刀的更多相关文章

  1. $python爬虫系列(2)—— requests和BeautifulSoup库的基本用法

    本文主要介绍python爬虫的两大利器:requests和BeautifulSoup库的基本用法. 1. 安装requests和BeautifulSoup库 可以通过3种方式安装: easy_inst ...

  2. python爬虫系列(2)—— requests和BeautifulSoup

    本文主要介绍python爬虫的两大利器:requests和BeautifulSoup库的基本用法. 1. 安装requests和BeautifulSoup库 可以通过3种方式安装: easy_inst ...

  3. 【网络爬虫入门01】应用Requests和BeautifulSoup联手打造的第一条网络爬虫

    [网络爬虫入门01]应用Requests和BeautifulSoup联手打造的第一条网络爬虫 广东职业技术学院 欧浩源 2017-10-14  1.引言 在数据量爆发式增长的大数据时代,网络与用户的沟 ...

  4. 基于Requests和BeautifulSoup实现“自动登录”

    基于Requests和BeautifulSoup实现“自动登录”实例 自动登录抽屉新热榜 #!/usr/bin/env python # -*- coding:utf-8 -*- import req ...

  5. Python使用urllib,urllib3,requests库+beautifulsoup爬取网页

    Python使用urllib/urllib3/requests库+beautifulsoup爬取网页 urllib urllib3 requests 笔者在爬取时遇到的问题 1.结果不全 2.'抓取失 ...

  6. python爬虫之requests+selenium+BeautifulSoup

    前言: 环境配置:windows64.python3.4 requests库基本操作: 1.安装:pip install requests 2.功能:使用 requests 发送网络请求,可以实现跟浏 ...

  7. requests和BeautifulSoup

    一:Requests库 Requests is an elegant and simple HTTP library for Python, built for human beings. 1.安装 ...

  8. Python 爬虫实战(一):使用 requests 和 BeautifulSoup

    Python 基础 我之前写的<Python 3 极简教程.pdf>,适合有点编程基础的快速入门,通过该系列文章学习,能够独立完成接口的编写,写写小东西没问题. requests requ ...

  9. #1 爬虫:豆瓣图书TOP250 「requests、BeautifulSoup」

    一.项目背景 随着时代的发展,国人对于阅读的需求也是日益增长,既然要阅读,就要读好书,什么是好书呢?本项目选择以豆瓣图书网站为对象,统计其排行榜的前250本书籍. 二.项目介绍 本项目使用Python ...

随机推荐

  1. hdu 1272

    并查集  要判断这个图是连通的 就是只有一个父节点 #include <cstdio> #include <cstring> #define maxn 100005 int f ...

  2. URAL 1353 Milliard Vasya's Function(DP)

    题目链接 题意 : 让你找出1到10^9中和为s的数有多少个. 思路 : 自己没想出来,看的题解,学长的题解报告 题解报告 //URAL 1353 #include <iostream> ...

  3. Google chrome的字体设置

    http://blog.sina.com.cn/s/blog_a3b863da01016sv3.html 谷歌浏览器(Google chrome)速度很快,很好用.问题是字体显示有时候不对:用英文版的 ...

  4. Django admin site(一)ModelAdmin Options

    Admin管理界面是django的杀手级应用.它读取你模式中的元数据,然后提供给你一个强大而且可以使用的界面,网站管理者可以用它立即向网站中添加内容. 要使用admin,可以按照下面的步骤: 将'dj ...

  5. UVA 10041 Vito's Family (中位数)

      Problem C: Vito's family  Background The world-known gangster Vito Deadstone is moving to New York ...

  6. 远程唤醒 N54L

    远程唤醒 N54L 我的N54L装了一块买时带的WD500G黑盘,又装了一个WD2T绿盘,存些电影歌曲什么的,当NAS用,装的WIN7系统,长时间不使用就自动关机了,每次都得按一下电源开关键,于是就研 ...

  7. PHP的(Thread Safe与Non Thread Safe)

    在安装xdebug到时候你会有有TS和NTS版本的选择,在以前还有VC6和VC9的版本.如果你没有根据你目前的服务器的状况选择对应的版本的话,那么xdebug是安装不成功的. 一.如何选择 php5. ...

  8. poj2750Potted Flower (线段树)

    http://poj.org/problem?id=2750 之前做过类似的题 把一段的左连续最大.最小 右连续最大及最小及中间的连续更新出 就可以算出这段最大的连续和 注意不能全部加上 加上一特判 ...

  9. 最小生成树(kruskal模版 模板)

    题目:http://acm.sdut.edu.cn/sdutoj/showproblem.php?pid=2144&cid=1186 #include<stdio.h> #incl ...

  10. 各种html5 的 polyfill

    https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills 配合 Modernizr