【问题标题】:How to use Ruby Mechanize to automatically like Facebook posts如何使用 Ruby Mechanize 自动为 Facebook 帖子点赞
【发布时间】:2011-01-23 16:34:20
【问题描述】:

我正在尝试创建一个自动“喜欢”Facebook 帖子的机器人。使用 Mechanize 我可以登录 facebook,但不幸的是,Mechanize 不理解指向“like”按钮的链接——它们似乎被 JS 混淆了。我看到的唯一链接是基础知识,例如:

 <Mechanize::Page::Link
 "Edit friends"
 "http://www.facebook.com/friends/?ref=tn">
 <Mechanize::Page::Link "Developers" "http://developers.facebook.com/?ref=pf">
 <Mechanize::Page::Link "Careers" "/careers/?ref=pf">
 <Mechanize::Page::Link "Terms" "/terms.php?ref=pf">
 <Mechanize::Page::Link "Find friends" "/find-friends/?ref=pf">
 <Mechanize::Page::Link "Privacy" "/policy.php?ref=pf">
 <Mechanize::Page::Link "Mobile" "/mobile?ref=pf">
 <Mechanize::Page::Link "Help Centre" "/help/?ref=pf">

有人知道如何让 Mechanize 看到“喜欢”链接吗?

谢谢

【问题讨论】:

    标签: ruby facebook mechanize bots


    【解决方案1】:

    为什么不尝试访问该网站的移动版本。 http://m.facebook.com。看起来 Like 链接没有使用任何 JS。

    【讨论】:

    • 成功了。不错的横向思维!我会永远在主站点上被黑,只需要访问移动版本。一般来说,对于屏幕抓取和机器人困难的好建议。干杯
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多