[PythonChallenge]第4关
来源:互联网 发布:js new date多一天 编辑:程序博客网 时间:2024/04/29 00:21
http://www.pythonchallenge.com/pc/def/linkedlist.php
网页的title是follow the chain
网页的注释中有提示, 需要修改nothing后面的数字少于400次
每修改一次都会在页面中显示下一次的数字, 重复操作即可
代码如下
import reimport urllib.requestfront_url = "http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing="num = "12345"for i in range(1, 400):url = front_url + numpage = urllib.request.urlopen(url)text_bytes = page.read()page.close()text = text_bytes.decode("utf8")result = re.findall(r"nothing is ([0-9]*)", text)if result == []:num = str(int(num) // 2)print(i, num, text)else:num = ''.join(result)print(i, num)
中间有一次会提示将数字除以2
最后结果为66831
页面为peak.html
输入地址栏即可进入下一关
- [PythonChallenge]第4关
- pythonchallenge第0关
- [PythonChallenge]第0关
- [PythonChallenge]第1关
- [PythonChallenge]第2关
- [PythonChallenge]第3关
- PythonChallenge 编程游戏-------第1关
- PythonChallenge 编程游戏-------第0关
- PythonChallenge 编程游戏-------第2关
- PythonChallenge 编程游戏-------第3关
- PythonChallenge第4题
- PythonChallenge闯关游戏——第0关
- PythonChallenge闯关游戏——第1-5关
- PythonChallenge闯关游戏——第6-10关
- PythonChallenge闯关游戏——第11-15关
- PythonChallenge闯关游戏——第16-20关
- pythonchallenge第二关
- PythonChallenge第二关
- java 基础复习 网络编程
- CASE WHEN 行转列 分拆解释
- POJ2271-字符串处理
- Codeforces Round #198 (Div. 2) / 340A The Wall (数论)
- UVA 10465 Homer Simpson(dp + 完全背包)
- [PythonChallenge]第4关
- Android中轴旋转特效实现,制作别样的图片浏览器
- POJ2623-模拟
- Android 开源框架ViewPageIndicator 和 ViewPager 仿网易新闻客户端Tab标签
- 网络爬虫返回json处理数据
- nutch常用命令
- 黑马程序员 .NET学习笔记 <3>
- 不想忘记的实习生活
- SPOJ1812(后缀自动机求n个串的最长公共子串)