Updated! Mechanize. Ruby. Can't get drop-down menu with dynamic content of hidden fields -
i'm not experienced in ruby + mechanize, starting, so... pls help. tried fill out form dynamic content. can't how step step.
that code:
#!/usr/bin/env ruby # encoding: utf-8 require 'rubygems' require 'mechanize' require 'logger' url = "https://visapoint.eu/visapoint2/disclaimer.aspx" agent = mechanize.new agent.user_agent_alias = 'mac safari' agent.log = logger.new(stdout) page = agent.get(url) page.encoding = 'utf-8' # disclamer.aspx object page disclamer_page = agent.page # click accept button on disclamer.aspx accept_button = disclamer_page.form.button_with(:value =>'accept') action_page = disclamer_page.form.click_button( accept_button ) # click new appointment button on action.aspx new_appointment_button = action_page.form.button_with(:name => 'ctl00$cphmain$btnnewappointment_input') form_page = action_page.form.click_button ( new_appointment_button ) # fill form on form.aspx page form_page.form['ctl00$cphmain$ddcitizenship'] = "kazakhstan (Қазақстан)" form_page.form['ctl00$cphmain$ddcountryofresidence'] = "kazakhstan (Қазақстан)" form_page.form['ctl00$cphmain$ddembassy'] = "#kazakhstan (Қазақстан) - astana" form_page.form['ctl00$cphmain$ddvisatype'] = "long-stay visa study" pp form_page.form formpage_next = agent.submit(form_page.form, form_page.form.buttons.last) pp formpage_next
after have send form_page, have expect reloaded page captcha, there nothing there... can 1 it?
Comments
Post a Comment