[解决方案] pythonchallenge level 4
http://www.pythonchallenge.com/pc/def/linkedlist.php
查看页面源代码或者点击图片
http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=12345
and the next nothing is 44827
本题将页面中的数字代替url中nothing的值
python:
import re
import requests
burl='http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing='
new=u'12345'
res=re.compile(r'and the next nothing is (\d+)')
while 1:
gurl=requests.get(burl+str(new))
content=gurl.text
print content
try:
value=re.findall(res,gurl.text)[0]
new,old=value,new
except:
status=raw_input('continue or break(c/b):')
if status=='c':
rnew=raw_input('input the next nothing is number(default:%s/2)):' % new)
if not rnew:
new = int(new)/2
else:
new = int(rnew)
else:
break
最后得到:peak.html
http://www.pythonchallenge.com/pc/def/peak.html
[解决方案] pythonchallenge level 4的更多相关文章
- [解决方案] pythonchallenge level 3
http://www.pythonchallenge.com/pc/def/equality.html 根据页面提示:一个小写字母刚刚好被左右3个大写字母包围. 查看页面代码得到需要处理的字符. 将字 ...
- [解决方案] pythonchallenge level 2
http://www.pythonchallenge.com/pc/def/ocr.html 根据页面提示查看网页源代码,在最后:<!--find rare characters in the ...
- [解决方案] pythonchallenge level 6
查看页面代码,知道找zip www.pythonchallenge.com/pc/def/channel.zip,查看zip下的readme.txt知道从90052,跑一遍知道要收集zip的comme ...
- [解决方案] pythonchallenge level 5
l5=requests.get("http://www.pythonchallenge.com/pc/def/banner.p") body = l5.text lists = p ...
- [解决方案] pythonchallenge level 1
http://www.pythonchallenge.com/pc/def/map.html g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amk ...
- [解决方案] pythonchallenge level 0
http://www.pythonchallenge.com/pc/def/0.html 问题: 2^38 >>> 2**38 >>>274877906944L 输 ...
- 20155205 2016-2017-2 《Java程序设计》第8周学习总结
20155205 2016-2017-2 <Java程序设计>第8周学习总结 教材学习内容总结 第十四章 NIO使用频道来衔接数据节点,可以设定缓冲区容量,在缓冲区中对感兴趣的数据区块进行 ...
- pythonchallenge 解谜 Level 8
#-*- coding:utf-8 -*- #代码版本均为python 3.5.1 #Level 7 import bz2 un=b'BZh91AY&SYA\xaf\x82\r\x00\x00 ...
- pythonchallenge 解谜 Level 7
#-*- coding:utf-8 -*- #代码版本均为python 3.5.1 #Level 7 from PIL import Image x_begin, x_end = 0, 609 y_b ...
随机推荐
- Window通过cmd查看端口占用、相应进程、杀死进程
在windows下启动程序时候经常出现端口占用, 修改本程序端口是一种解决思路,但是更多时候希望直接杀掉占用端口的程序: 一. 查看所有进程占用的端口 在开始-运行-cmd,输入: netsta ...
- [HTML/HTML5]4 使用文本
4.1 组织文本 在已经采用结构化方式将页面划分为多个关键内容区域(content area)并添加相应的标题之后,就可以进一步对这些内容区域中的文本进行组织. 4.1.1 段落 p元素的具体功能 ...
- linux上使用shell脚本查看内存使用率
如上的内存利用率 = [-/+buffers/cache:used]/[Mem:total ] = 6293404 / 16333656 对于free命令而言,有如下公式: total = used ...
- php学习函数
1defined和define区别 2.dirname(__FILE__) 3.set_include_path 4.get_include_path 5.realpath() 6.require_p ...
- guava学习--SettableFuture
转载:https://my.oschina.net/realfighter/blog/349931 翻开SettableFuture的源码,我们看到SettableFuture继承了AbstractF ...
- 搭建一个分布式MongoDB鉴权集群
今天休假在家,测试并搭建了一个replica set shard MongoDB鉴权集群.replica set shard 鉴权集群中文资料比较少,本文是个人笔记,同时也希望对后来者有所帮助.本文仅 ...
- Proxy Pattern(Java动态代理和cglib的实现)
代理模式:给某一个对象提供代理对象,由代理对象控制具体对象的引用. 代理,指的就是一个角色对表另一个角色采取行动,就生活中,一个红酒厂商,是不会直接把红酒零销给客户的,都是通过代理完成他的销售业务.而 ...
- Java集合类学习笔记(各种Map实现类的性能分析)
HashMap和Hashtable的实现机制几乎一样,但由于Hashtable是一个古老的.线程安全的集合,因此HashMap通常比Hashtable要快. TreeMap比HashMap和Hasht ...
- sasasa
/***************************************************************************************** 文件:app_to ...
- CentOS 6.6编译安装Nginx1.6.2+MySQL5.6.21+PHP5.6.3
http://www.osyunwei.com/archives/8867.html 一.配置防火墙,开启80端口.3306端口 vi /etc/sysconfig/iptables #编辑防火墙配置 ...