Python请求-发布请求后网站未更新

时间:2020-08-09 18:13:21

标签: python python-requests

我正在尝试使用python请求在网站上收集一些数据。但是,发布数据后,内容仍不会更新。

我正在访问的站点是https://www.avanza.se/placera/forum/start.html?,更新参数的帖子应该是https://www.avanza.se/forum/user-preferences/posts-per-page。当用户更改在起始站点上完成的每页发布数时,请求每页发布数。如果响应正确,那么我希望看到200个forumPyjamasRow类,因为一个forumPyjamasRow对应于一个帖子。有谁知道为什么这不起作用?

import requests
 
s = requests.session()
 
# Sending post requests to update cookies (Expected response 204)
s.post('https://www.avanza.se/forum/user-preferences/posts-per-page', data={"posts":"200"})
 
# Aquire the updated content (Currently this is failing I think)
r = s.get("https://www.avanza.se/placera/forum/start.html?")
 
# Expect to see 200 forumPyjamasRow classes if the code succeded
r.text

0 个答案:

没有答案