-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpythonchallenge4.py
More file actions
32 lines (26 loc) · 894 Bytes
/
Copy pathpythonchallenge4.py
File metadata and controls
32 lines (26 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# http://www.pythonchallenge.com/pc/def/linkedlist.php
from pytest import param
import requests
import re
url = "http://www.pythonchallenge.com/pc/def/linkedlist.php"
params ={'nothing' : 12345}
response = requests.get(url,params=params)
while True:
params['nothing']= re.sub(r'[^0-9]','',response.text)
response = requests.get(url,params = params)
if('and the next nothing' not in response.text):
print(response.text)
break
else:
print(response.text[-5:])
# 중간에 한번 수동작업 해줘야 함
params = {'nothing' : 8022}
response = requests.get(url,params=params)
while True:
params['nothing']= re.sub(r'[^0-9]','',response.text)
response = requests.get(url,params = params)
if('and the next nothing' not in response.text):
print(response.text)
break
else:
print(re.sub(r'[^0-9]','',response.text))