I am trying to use Ruby and Mechanize to log into a website, but with one particular log in form I am having trouble. Code is below. For some reason, Mechanize does not seem to recognize the form.
Mechanize.new.get("website").form returns nil & .forms returns [].
agent = Mechanize.new
fm_raw_mechanize = agent.get("http://ift.tt/186sRdE")
fm_form = fm_raw_mechanize.form #nil
fm_form.login = "rebeccamhathaway@gmail.com"
fm.password = "classpass"
fm.submit
Any ideas here? Should I try another similar gem? If so, do you have any recommendations?
Aucun commentaire:
Enregistrer un commentaire