Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ruby mechanize in Facebook

I'm trying to click the Settings button on the home page, but when I do I get this page back:

#<WWW::Mechanize::Page
 {url
  #<URI::HTTP:0x1023c5fc0 URL:http://www.facebook.com/editaccount.php?ref=mb&drop>}
 {meta}
{title nil}
{iframes}
{frames}
{links}
{forms}>

which is.. kinda empty! Is there some problems with these iframes and frames stuff maybe?

like image 271
luca Avatar asked Apr 10 '26 13:04

luca


1 Answers

As roja mentioned, following redirects might be what you need. Here's an example of how to do this:

@agent = Mechanize.new
@agent.redirect_ok = :all
@agent.follow_meta_refresh = :anywhere

Then you can pretty much ignore the fact that there's redirects involved - Mechanize will simply put you on the resulting page.

like image 116
sarahg Avatar answered Apr 12 '26 08:04

sarahg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!