Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
263 views
in Technique[技术] by (71.8m points)

python request just open url, don't need show or open in browser

I make api call in another project, for example i got url http://localhost:5000/api/test. After i do this link on my browser, the file have updated. But i need make it on my python bot calls. So i try to use request.

import requests
requests.get('http://localhost:5000/api/test')

But then file who are in http://localhost:5000/api/test was not updated.

I know its very complicated, but maybe anyone have idea? I don't need browser open i dont need any reaction, i just need with code open what url, and when correctly file will be updated.

UPDATED INFORMATION

then i click on browser the link http://localhost:5000/api/test im getting {"success": true} and the file was updated with now data.

Then i try with my code im getting

    HTTP connection (1): localhost:5000 DEBUG:urllib3.connectionpool:http://localhost:5000 "GET /api/test HTTP/1.1" 302
 219 DEBUG:urllib3.connectionpool:Resetting dropped connection: localhost DEBUG:urllib3.connectionpool:http://localhost:5000 "GET /login HTTP/1.1" 200 4470 200

But my file was not updated.

question from:https://stackoverflow.com/questions/65936499/python-request-just-open-url-dont-need-show-or-open-in-browser

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...