【发布时间】:2021-05-01 00:02:32
【问题描述】:
我试图用 Python 编写一个用于自动填充网页的脚本,显然是给出正确的输入,然后得到网页生成的输出,但我是 Python 新手,所以我有点迷茫。 我正在尝试使用的网页是这个: https://t-ict4d.ictp.it/nequick2/nequick-2-web-model
我已经看到页面源代码并打开了“nequick.js”
在那里,我找到了所需的数据字符串,并且已经在 python 上创建了它,并在代码中提供了之前的所有变量值:
datastring = { "lat1":"lat1", "lon1":"lon1", "h1":"h1", "lat2":"lat2", "lon2":"lon2", "h2":"h2", "year":"year", "month":"month", "day":"day", "hour":"hour", "localtime":"localtime", "user":"user", "r12_f":"r12_f", "sol_val":"sol_val", "itu":"itu" }
但是当我执行requests.post(url,data=datastring) 时,输出不是我想要的那个网页的输出。
有谁知道我在直接填充网页时获得输出时缺少什么?
谢谢!
【问题讨论】:
标签: python python-requests http-post python-requests-html