http://www.pythonchallenge.com/pc/return/italy.html
照例输入huge file进入。
图就不放了,反正就是那个页面,标题是 walk around,那我们就到处逛一逛哈,面包,一个色板(估计要查一查它的像素信息)
<html>
<head>
<title>walk around</title>
<link rel="stylesheet" type="text/css" href="../style.css">
</head>
<body>
<center>
<img src="italy.jpg"><br>
<br>
<!-- remember: 100*100 = (100+99+99+98) + (... -->
<img src="wire.png" width="100" height="100">
</body>
</html>
这里有个comment提示,另外有个wire.png,点进去没图片,估计又是藏着什么文本。
先针对怀疑的两点试试看看。注意这里的httpbasicAuth认证。
(1)wire.png.
import requests.auth
url = 'http://www.pythonchallenge.com/pc/return/wire.png'
auth = requests.auth.HTTPBasicAuth('huge', 'file')
response = requests.post(url, auth=auth)
response.encoding = response.apparent_encoding
print(response.content.decode())
报错提示utf-8无法解码??wtf??稍等保存一下。
看看像素信息呢?
# -*- coding: utf-8 -*-
from PIL import Image
image = Image.open('wire.png')
width, height = image.size
# print(width, height)
pix = image.load()
for x in range(width):
print(pix[x,