0

I was trying to make a script in Python for the automatic filling of a webpage, obviously giving the ight inputs and then getting the output generated by the webpage, but I'm new with Python so I'm a little lost. The webpage I'm trying to work with is this one: https://t-ict4d.ictp.it/nequick2/nequick-2-web-model

I already saw the page source code and opened the "nequick.js"

There I found the datastring needed and already made it on python, giving all variables values previously on the code: 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" }

but then when I do requests.post(url,data=datastring), the output is not the output that I want from that webpage.

Does anyone know what's missing for me to get the output like when the webpage is filled directly?

Thank you!

0

2 Answers 2

1

The way you're creating your dictionary is wrong, should be:

"lat1":lat1,"lon1":lon1,"h1":h1,...

Have a look here if you're having some trouble: Python dictionaries

Sign up to request clarification or add additional context in comments.

1 Comment

Okey, thank you! That was one mistake, but the output is still not correct
0

You will try this way

r = request.post(url,data=datastring)
print(r.json()) or print(r.text)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.