2024-09-26 17:46:43 发布
网友
我尝试使用python中的请求来访问网页刮取此页面:
在网页https://www.otpbanka.hr/tecajna-lista上有请求URL:https://www.otpbanka.hr/otp/ajax/exchange,但方法是POST
在dev tools In Response选项卡中,我可以看到内容的JSON代码,但有没有一种方法可以在Python中读取它
多谢各位
快速查看一下请求,似乎有一个表单数据也要传递,以便服务器响应所需的结果,否则它只会返回什么(无主体)
尝试:
import requests query_data = { "q1": "latest", "q2": "OTP", "q3": '', "q4": 'DISPLAY' } response = requests.post('https://www.otpbanka.hr/otp/ajax/exchange', data = query_data) if response.status_code == 200: print(response.json()) else: print(response.status_code)
快速查看一下请求,似乎有一个表单数据也要传递,以便服务器响应所需的结果,否则它只会返回什么(无主体)
尝试:
相关问题 更多 >
编程相关推荐