使用RSS提要获取公共google组主题标题

2024-10-01 15:45:48 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图从RSSfeed中获取公共google组中所有主题的标题。我想弄到所有的题目。它几乎有8000个主题。我使用下面的代码使用feedparser读取提要。在

import feedparser
url = 'https://groups.google.com/forum/feed/caffe-users/topics/rss_v2_0.xml?num=50'
feed = feedparser.parse(url)
for entry in feed['entries']:
    content = entry['title']
    print(content)

我注意到当我使用num = 50时,我得到了所有50个标题。甚至连标题都改了?输出如下:

^{pr2}$

你知道为什么会这样吗?当num = 50时,我得到50个标题,但是为什么当我增加num的值时,获取的标题会减少到一个固定的数字15? 任何帮助或建议将不胜感激。谢谢。 使用库gggd我面临以下问题:

atan-115b-02:src mislam$ ./gggd.py -l -C cookies.txt caffe-users Please log in to your Google groups account (navigate the form fields with up and down arrows, submit form with Enter) and then exit the browser (using the 'q' key). Press Enter to continue.

Alert!: This client does not contain support for HTTPS URLs.

lynx: Can't access startfile https://www.google.com/a/UniversalLogin?continue=https://groups.google.com/forum/&service=groups2&hd=default gggd.py: ValueError("invalid literal for int() with base 10: 'client'",) for help use --help


Tags: thehttpscomurl标题主题forfeed
1条回答
网友
1楼 · 发布于 2024-10-01 15:45:48

要从这个Google群组下载所有的信息,你需要使用RSS之外的其他界面。googlegroups RSS界面最多只能发送50条最新消息。没有分页或日期支持,因此不能使用RSS接口从组中获取所有消息。在

解决方案

Get Google Groups Data是一个Python2项目,它对指定的Google组进行爬网并下载其所有消息。在我的Mac上安装了lynx之后,我就可以在源代码中找到caffe-users论坛。在

截图如下。祝你好运。在

enter image description here

相关问题 更多 >

    热门问题