ruby - Can mechanize work with browsers? -
i using ruby's gem mechanize automate file upload after logging in particular site.. able login using
#!/usr/bin/ruby require 'rubygems' require 'mechanize' #creating object mechanize class = mechanize.new { |agent| # site refreshes after login agent.follow_meta_refresh = true } #getting page a.get('https://www.samplesite.com/') |page| puts page.title form = page.forms.first form.fields.each {|f| puts f.name} form['username'] = "username" form['password'] = "password" # submitting form , reaching page
now there 2 questions... a. can see happening on browser using agent or tool? b. there way keep mechanize waiting page load?
do try selenium webdriver ?
should integrates ruby program
Comments
Post a Comment