计算式子的值然后使用post方法传值。直接脚本跑。
import requests
import re
url = "http://123.206.87.240:8002/qiumingshan/"
s = requests.session()
htmlsource = s.get(url).text
exp = re.search(r'(\d+[+\-*])+(\d+)',htmlsource).group()
post = {'value':eval(exp)}
a = s.post(url,data=post)
print(a.text)

本文介绍了一种使用Python进行表达式计算并将结果通过POST请求发送的方法。具体步骤包括:利用requests库获取网页源代码,使用正则表达式解析出计算表达式,计算表达式的值,最后将结果作为参数通过POST方法发送回服务器。
1389

被折叠的 条评论
为什么被折叠?



