猫史档案馆


【求助】谁会用python代码给论坛发评论?

用户:会python的狸忍会python的狸忍查看:17 回复:8 评论:17 创建时间:2020-08-23T19:32:41


谁会用python代码给论坛发评论?


回复

上一页1 页 / 共 1下一页
蒟蒻OIer1048576蒟蒻OIer1048576

我会

点赞0


评论


蒟蒻OIer1048576蒟蒻OIer1048576

点F12!你点NetWork,再发一条评论!

点赞0


评论


蒟蒻OIer1048576蒟蒻OIer1048576

会有https://api.codemao.cn/web/forums/posts/33喵30/replies

点赞0


评论


wrmdcxywrmdcxy

import requests
from json import dumps
headers={
	'Content-Type': 'application/json',
	'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; ) AppleWebKit/537.36 (KHT'+'ML, like Gecko) Chrome/81.0.4044.92 Safari/537.36'
}
data_user={
	"identity":"用户名",
	"password":"密码",
	"pid":"65edCTyg"
}
data_message={
	"title":"标题",
	"content":"<p>内容</p>"
}
ses=requests.session()
ses.post('https://api.codemao.cn/tiger/v3/web/accounts/login',headers=headers,data=dumps(data_user))
ses.post('https://api.codemao.cn/web/forums/boards/11/posts',headers=headers,data=dumps(data_message))

点赞0


评论


wrmdcxywrmdcxy

这我干过

https://shequ.codemao.cn/community/284885

点赞0


评论


会python的狸忍会python的狸忍

为什么报错了?

点赞0


评论


会python的狸忍会python的狸忍

center_image

点赞0


评论


lsk666666lsk666666

pid获取:

headers = {"Content-Type": "application/json", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; ) AppleWebKit/537.36 (KH喵L, like Gecko) Chrome/81.0.4044.138 Safari/537.36"}
	shequ = requests.get('https://shequ.codemao.cn', headers = headers)
	soup = BeautifulSoup(shequ.text, 'html.parser')
	pid = loads(soup.find_all("script")[0].string.split("=")[1])['pid']

点赞0


评论