[解决方案] 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 ...
随机推荐
- 20145224&20145238 《信息安全系统设计基础》 第三次实验
20145224&20145238 <信息安全系统设计基础>第三次实验 课程:信息安全系统设计基础 班级:1452 姓名:陈颢文 荆玉茗 学号:20145224 20145238 ...
- jQuery滚动数字
<ul class="dateList"> <li class="one"> <p class="titleName&q ...
- WPF 数据绑定Binding
什么是数据绑定? Windows Presentation Foundation (WPF) 数据绑定为应用程序提供了一种简单而一致的方法来显示数据以及与数据交互. 通过数据绑定,您可以对两个不同对象 ...
- the usage of map.put
这个不用要的那么详细,对于应用来说,比如举个例子: Map map = new HashMap();map.put("key","value");这样就存入了一 ...
- C#线程通信与异步委托
线程的通知机制 AutoResetEvent是线程实现通知操作的重要方法.通常,AutoResetEvent用于通知正在等待线程已发生事件,允许线程通过发信号互相通信. AutoResetEvent时 ...
- 通过Maven插件发布JaveEE项目到tomcat下
1.修改tomcat\conf\tomcat-users.xml文件,在文件中增加 <role rolename="manager-script"/> <user ...
- SVN使用教程
SVN简介: 为什么要使用SVN? 程序员在编写程序的过程中,每个程序员都会生成很多不同的版本,这就需要程序员有效的管理代码,在需要的时候可以迅速,准确取出相应的版本. Subversion是什么? ...
- 使用 WinHttp 实现文件下载
#include <Windows.h> #include <Winhttp.h> #pragma comment(lib,"Winhttp.lib") t ...
- (DFS、全排列)POJ-3187 Backward Digit Sums
题目地址 简要题意: 输入两个数n和m,分别表示给你1--n这些整数,将他们按一定顺序摆成一行,按照杨辉三角的计算方式进行求和,求使他们求到最后时结果等于m的排列中字典序最小的一种. 思路分析: 不难 ...
- Log4J详解
Log4J 简介 Log4j有三个主要的组件:Loggers(记录器),Appenders (输出源)和Layouts(布局).这里可简单理解为日志类别,日志要输出的地方和日志以何种形式输出.综合使 ...