<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Bil,<br><br>It's possible there is more to it than this, but looking at the page it appears that you have the field names wrong for the login form. Also, the login submit button is an image, which is a hoop I've had to jump through before, even so far as having to specify the exact coordinates of where I "clicked" on the button, so tell it to submit using that button specifically. Since there is only one button on that form, you can just use the following for your login form:<br><br>login_form = agent.page.form('login')<br>login_form.set_fields(:session_key => 'LOGIN', :session_password => 'PASSWORD')<br>agent.submit(login_form, login_form.buttons.first)<br><br>When I tried this, it said that my credentials
were invalid, so hopefully it will work for you as you actually have a login :). Good luck!<br><br>Matt White<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Bil Kleb <Bil.Kleb@NASA.gov><br>To: mechanize-users@rubyforge.org<br>Sent: Tuesday, August 21, 2007 9:56:40 AM<br>Subject: [Mechanize-users] Signin to LinkedIn<br><br><div>Hi,<br><br>Does anyone have the formula for getting logged into LinkedIn?<br><br>Here's my current attempt:<br><br> require 'rubygems'<br> require 'mechanize'<br><br> agent = WWW::Mechanize.new<br><br> home_page = agent.get('<a target="_blank" href="http://www.linkedin.com">http://www.linkedin.com</a>')<br><br> signin_page = agent.click home_page.links.text('Sign in')<br> puts "\nSIGNIN PAGE"<br> pp signin_page<br><br> login_form =
signin_page.form('login')<br> login_form.session_login = 'LOGIN'<br> login_form.session_password = 'PASSWORD'<br><br> welcome_page = agent.submit(login_form, login_form.buttons.first)<br> puts "\nWELCOME PAGE"<br> pp welcome_page <<<< Currently returns signin page<br><br>I tried mucking about with a session key, but no joy:<br><br> login_form.session_rikey = agent.cookies.find{ |c| 'JSESSIONID' == c.name }.value<br><br>(My goal is to scrape a list of my connections' new connections.)<br><br>Thanks,<br>--<br>Bil Kleb<br><a target="_blank" href="http://nasarb.rubyforge.org">http://nasarb.rubyforge.org</a><br>_______________________________________________<br>Mechanize-users mailing list<br>Mechanize-users@rubyforge.org<br><a target="_blank"
href="http://rubyforge.org/mailman/listinfo/mechanize-users">http://rubyforge.org/mailman/listinfo/mechanize-users</a><br></div></div><br></div></div><br>
<hr size=1>Moody friends. Drama queens. Your life? Nope! - their life, your story.<br> <a href="http://us.rd.yahoo.com/evt=48224/*http://sims.yahoo.com/">Play Sims Stories at Yahoo! Games. </a></body></html>