I am making a script that requires a spotify login, and I have this code:
require 'mechanize'
mechanize = Mechanize.new
page = mechanize.get('https://accounts.spotify.com/en/login')
form = page.forms.first
form['username'] = 'username'
form['password'] = 'password'
page = form.submit
this code leaves me with this error:
:in `<top (required)>': undefined method `[]=' for nil:NilClass (NoMethodError)
however, if I try the same code on facebook (of course chaning the names), or any other site I've tried I get no error. Could this have something to do with spotifys form not having a post method? I am not too familiar with this kind of stuff, and help would be appreciated!