from urllib import request count= range( 0, 255) text= [ ] file = open( "e:\\1.txt" , "w" ) for i in count: webfile= "http://www.pythonchallenge.com/pc/def/" + "%d" % i+ ".html" print ( "访问" + webfile+ "\n" ) try : web= request. urlopen( webfile) web_html= web. read( ) text. append( "%s" % web_html) file. write( "第%d个文件" % i+ "文件名" + webfile+ "\n" ) file. write( txt) file. write( "写入结束 \n \n" ) web. close( ) except Exception : print ( "error \n" ) web. close( ) pass file. close( ) print ( "结束" )
待续 挑战:http://www.pythonchallenge.com/pc/def/0.html
笨啊,
很简单: 2**38 直接访问这个页面即可过关
<script type=text/javascript charset=utf-8 src="http://static.bshare.cn/b/buttonLite.js#style=-1&uuid=&pophcol=3&lang=zh"></script> <script type=text/javascript charset=utf-8 src="http://static.bshare.cn/b/bshareC0.js"></script>
阅读(278) | 评论(0) | 转发(0) |