bugku-web-秋名山老司机
拿到题目发现只有刷新后变化的式子,所以同理还需要使用Session,request方法来做。
直接上python2:
# -*- coding:utf-8 -*-
import requests
url = 'http://123.206.87.240:8002/qiumingshan/'
url_session = requests.Session()
url_req = url_session.get(url)
#打印响应状态
print url_req
#获取式子,产找div标签内容,并结尾=?,同时去除<div>标签
shizi = url_req.text[url_req.text.find('<div>'):url_req.text.find('=?')].split('<div>')[1]
#expression = re.search(r'(\d+[+\-*])+(\d+)', source.text).group()
#page = re.findall(r'<div>(.*)=\?;</div>', g.text)[0]
#式子做运算
sum_shizi = eval(shizi)
print sum_shizi
#以post方法穿参
post = url_session.post(url,{'value':sum_shizi})
print post.text
Bugku{YOU_DID_IT_BY_SECOND}
有大概率获取不到,跟网速也有关系