반응형
www.pythonchallenge.com/pc/def/linkedlist.php
follow the chain
www.pythonchallenge.com
페이지 소스내의 링크로 접속
url의 일부분을 변경해가며 답을 찾아내는 문제인것 같다.
import urllib.request
import re
html='http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing='
response = requests.get(html+'0000')
i=0
while i<400:
i+=1
nem = response.text
data=re.findall("[0-9]+",nem)
# datastr=data[0]
print(response.text,data)
response = requests.get(html+data[0])
#peak.html
-정규 표현식을 이용하여 숫자를 추출하여 문제를 풀이함
반응형
'Python > The Python Challenge' 카테고리의 다른 글
The Python Challenge 3 (0) | 2020.12.26 |
---|---|
The Python Challenge 2 (0) | 2019.06.02 |
The Python Challenge 1 (0) | 2019.06.02 |
The Python Challenge 0 (0) | 2019.06.02 |