tweakers.net的python包装器
tweakers的Python项目详细描述
调整器
的python包装器安装
pip install tweakers
用法
import tweakers
收集
使用tweakers.gathering
模块,您可以访问论坛。
活动主题
for topic in tweakers.gathering.active_topics():
print(topic.title)
搜索
for topic in tweakers.gathering.search('tweakers.net'):
print(topic.title)
主题
获取特定主题的评论
topic = Topic("https://gathering.tweakers.net/forum/list_messages/1551828")
for comment in topic.comments(page=1):
print(comment.user.name, comment.text)
添加评论时生成新评论
for comment in topic.comment_stream():
print(comment.user.name, comment.text)
登录
tweakers.login("YOUR_USERNAME", "YOUR_PASSWORD")
现在您可以访问已注销用户无法访问的页面:
for topic in tweakers.gathering.bookmarks():
print(topic.name)