pythonchallenge 解谜 Level 4
下一关。。。
一张图片,于是就点击了一下。
跳转到了
http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=12345
显示的是:
and the next nothing is 44827
下一个。。。
and the next nothing is 45439
再来一个。。
Your hands are getting tired and the next nothing is 94485。。。
一直循环下去了。。。肯定是打开的方式不对。。
回到原网页,F12
<!-- urllib may help. DON'T TRY ALL NOTHINGS, since it will never
end. 400 times is more than enough. -->
额。回去上课,回来发代码。
这个有点坑爹。代码就直接发了。原理就是获取下一个链接的 nothing 然后用python 帮你自动进入下一个网页。大量循环。
#-*- coding:utf- -*-
#代码版本均为python 3.5.
#Level import urllib.request
import re def next_page(p):
text = urllib.request.urlopen('http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=%s' % p).read().decode('utf-8')
m = re.search('and the next nothing is ([0-9]+)', text)
if not m: print (text)
return m.group() p = for i in range(,):
print (" 第%s次运行" % i,end="")
p = next_page(p)
print (p)
所以可以得到第5关的链接。
http://www.pythonchallenge.com/pc/def/peak.html
目前对第5关一脸懵bi。。。
晚上解
pythonchallenge 解谜 Level 4的更多相关文章
- pythonchallenge 解谜 Level 0
解谜地址: http://www.pythonchallenge.com/pc/def/0.html 这题没什么难度,意思就是得到2的38次方的值,然后,替换 http://www.pythoncha ...
- pythonchallenge 解谜 Level 6
第六关地址 http://www.pythonchallenge.com/pc/def/channel.html 和前几关一样,首先看网页源码吧.反正不看也没办法... <html>< ...
- 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 ...
- pythonchallenge 解谜 Level 5
第五关的确很坑爹... 不过,根据之前的思路,我想着是把信息放在了 “源码” 中. 翻了下源码.有用的东西在以下部分. <html><head> <title>pe ...
- pythonchallenge 解谜 Level 3
第三关. 问题的解法在于正则表达式. 首先...你应该能找到需要正则的字符在哪里...那就好了! 题意就是说: One small letter, surrounded by EXACTLY thre ...
- pythonchallenge 解谜 Level 2
好吧,赶紧贴一下. #-*- coding:utf-8 -*- #代码版本均为python 3.5.1 #Level 2 import re file = open("Level 2.txt ...
- pythonchallenge 解谜 Level 1
得到第一关地址后可以进行第一关的解析了. 看起来好神秘的样子.但是也就是把字母 k 变成 m , o 变成 q ,e 变成 g.将字母对应的ASCII的值+2就行了. #-*- coding:utf- ...
- pythonchallenge 解谜
所有代码均使用python 3.5.1 版本 最近在学python,闲来无事觉得这个解谜还挺有意思. 解谜网址 http://www.pythonchallenge.com/ 接下来会写破解教程~
随机推荐
- dom操作导致超级卡顿。。。
var i=0;j=30;setinterval(function(){ document.getElementId(idname).style.top=j+'px'; i<3?i++:i=0; ...
- 中间件Study-了解什么是中间件
一.中间件含义:中间价是位于各种平台(硬件和操作系统)和各种应用之间的通用服务. 帮助应用实现高效的.可靠的消息使应用之间实现便捷的互联互通高效.可靠构建企业应用实现分布式应用的快速搭建和部署注:中间 ...
- CentOS7 安装中文帮助手册
1.首先确定系统安装中文字体否 locale 2.rpm安装中文帮助手册 挂在光盘 将man-pages-zh-CN-1.5.2-4.el7.noarch.rpm拷贝到本机 rpm -ivh man- ...
- Object-c 内存管理
内存管理 主要内容 1.内存管理的概念 2.引用计数 3.如何持有对象所有权 4.自动释放池 5.@property的使用 什么是内存管理 内存管理是关于如何管理对象生 ...
- 利用代码添加autolayout约束
1.概述 通常我们通过storyboard能够完成的,代码也能够完成,所以这里介绍下代码实现约束的添加,通常我们不这么干(在不使用第三方框架的情况下,使用系统自带的类添加约束特别繁琐),所以这里仅仅简 ...
- c语言学习笔记三
第三章,函数 字符串函数 //strcmp int my_strcmp(char *str1,char *str2) { while(*str1 = = *str2) /*不可用while(* ...
- 浅谈redis和memcached的区别
缓存技术方面说到redis大家必然会联想到memcached,了解它们的人应该都知道以下几点吧 redis与 memcached相比,redis支持key-value数据类型,同事支持list.set ...
- Pyqt 基础功能
总结Pyqt的基础知识 1. Pyqt 设置禁止最大化及禁止拖拽窗口大小 # PyQT禁止窗口最大化按钮: self.setWindowFlags(QtCore.Qt.WindowMinimizeB ...
- jq 模板
菜鸟教程1.4.6版本angularJS <script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js ...
- Android应用请求获取Root权限
应用获取Root权限的原理:让应用的代码执行目录获取最高权限.在Linux中通过chmod 777 [代码执行目录] /** * 应用程序运行命令获取 Root权限,设备必须已破解(获得ROOT权限) ...