如何使用 mechanize 抓取谷歌阅读器(使用 cookie)

发布于 2024-10-07 09:02:42 字数 766 浏览 0 评论 0原文

我正在尝试抓取谷歌阅读器,但我遇到了问题...我希望登录谷歌阅读器并获得有效的cookie...然后尝试进入此页面:

'http://www.google.es/reader/atom/user/-/state/com.google/reading-list'

如果我的cookie有效并且我已登录我只需要输入“user/-/”,它将进入我的谷歌阅读器的XML版本......

理论上......我登录谷歌阅读器内部并重定向......然后我复制我的SID ....我使用它创建一个手动cookie,并

http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI

name SID
domain .google.com
path /
expires 1600000000

使用我的cookie创建谷歌阅读器的API信息我尝试在里面输入:

'http://www.google.es/reader/atom/user/-/state/com.google/reading-list'

但它不起作用....我想我正在创建我的cookie不好的方式,但我阅读了有关 CookieJarMechanize::Cookie 的 API,但我没有找到任何有关如何使用它的示例......我已经尝试过有不同的方法,但都不起作用...请有人可以帮助我如何使用这个cookie...

I'm trying scrape google readers but I've got problems...I wish to log in google readers and get a valid cookie...then try enter in this page:

'http://www.google.es/reader/atom/user/-/state/com.google/reading-list'

if my cookies work and I'm logged in I only need to put "user/-/" and it will enter inside my google reader's XML version....

It's in theory ... I log in inside google readers and it redirects ... then I copy my SID .... and I create a manual cookie using this and the google reader's API info

http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI

name SID
domain .google.com
path /
expires 1600000000

with my cookie create I try enter inside:

'http://www.google.es/reader/atom/user/-/state/com.google/reading-list'

but it don't work .... I think I'm creating my cookie in a bad way but I read the API about CookieJar and Mechanize::Cookie, but I don't find any example about how to use it ... I've tried in different ways but none work ... please someone can help me about how use this cookie....

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

多彩岁月 2024-10-14 09:02:42

我们使用 iMacros 进行所有网络抓取(部分免费/开源,部分商业)。效果很好。无论您使用什么,您都需要能够自动化真实网络浏览器的东西。其他选项是 Selenium 或 Watir,尽管它们更适合 Web 测试。

We do all our web scraping with iMacros (partly free/open source, partly commercial). That works well. No matter what you use, you need something that automates a real web browser. Other options are Selenium or Watir, although these are more geared towards web testing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文