search for: user_agent_alia

Displaying 17 results from an estimated 17 matches for "user_agent_alia".

Did you mean: user_agent_alias
2008 Nov 03
2
Multiple Submit Buttons
Hello. I have run into a new form that contains multiple submit buttons. Currently my code for working with forms looks just like this example. require ''rubygems'' require ''mechanize'' a = WWW::Mechanize.new { |agent| agent.user_agent_alias = ''Mac Safari'' } a.get(''http://google.com/'') do |page| search_result = page.form_with(:name => ''f'') do |search| search.q = ''Hello world'' end.submit search_result.links.each do |link| puts lin...
2007 May 06
1
How to submit this form?
Hey all, maybe I am missing the obvious again, but I can not submit the form on buy.com: require ''rubygems'' require ''mechanize'' agent = WWW::Mechanize.new agent.user_agent_alias = ''Mac Safari'' page = agent.get("http://www.buy.com") search_form = page.forms.with.name("searchbox").first p search_form.buttons the last array is empty... OK, probably ''GO'' is not a button - but then what it is? How to submit such forms i...
2007 Apr 19
1
Do you have any idea what could be the problem with this script?
Hello all, If I run this script, and observe the output, the results are not there at all (try to do the same in the browser). Any suggestions? require ''rubygems'' require ''mechanize'' agent = WWW::Mechanize.new agent.user_agent_alias = ''Mac Safari'' page = agent.get("http://www.sbstransit.com.sg/iris3/bus_serviceopt.aspx") search_form = page.forms.with.name("Form1").first search_form.txtsvcno = "014" search_form.txtbusstop = ''92129'' search_results...
2007 Apr 20
2
Running script does not return the correct page
...subscribed yet... Well, here we go again: If I run this script, and observe the output, the results are not there at all (try to do the same in the browser). Any suggestions? require ''rubygems'' require ''mechanize'' agent = WWW::Mechanize.new agent.user_agent_alias = ''Mac Safari'' page = agent.get("http://www.sbstransit.com.sg/iris3/bus_serviceopt.aspx") search_form = page.forms.with.name("Form1").first search_form.txtsvcno = "014" search_form.txtbusstop = ''92129'' search_results...
2007 Oct 04
2
newbie question with login form
hi, i''m just starting to work with this incredible tool... but i got a first problem with the login process i''m logging on my app like this : ------ @agent = WWW::Mechanize.new { |a| a.log = Logger.new("mech.log") } @agent.user_agent_alias = ''Mac Safari'' @page = @agent.get("http://myappAdress/") @form = @page.forms.first @form[''form_login''] = ''myLog'' @form[''form_password''] = ''myPass'' @page = @agent.submit(@form, @form.buttons.fir...
2007 Jul 12
1
WWW::Mechanize::Link.inspect needs some TLC
...plicate the cause of this crash in ruby-debug as well. Here''s a sample session, with this code: require ''rubygems'' require ''mechanize'' require ''logger'' agent = WWW::Mechanize.new { |a| a.log = Logger.new("mech.log") } agent.user_agent_alias = ''Mac Safari'' page = agent.get("http://www.google.com/") search_form = page.forms.name("f").first search_form.fields.name("q").value = "bratislava tournament" search_results = agent.submit(search_form) puts search_results.body Given this...
2011 Mar 27
2
LinkedIn still not working?
...;1.9'' require ''open-uri'' require ''nokogiri'' require ''mechanize'' agent = Mechanize.new agent.read_timeout = 300 agent.open_timeout = 60 agent.max_history = 1 # Prevent excessive memory usage agent.user_agent_alias = ''Mac Safari'' page = agent.get(https://www.linkedin.com/secure/login?trk=hb_signin) form = page.form(''login'') form.session_key = USERNAME form.session_password = PASSWORD new_page = form.click_button Any help would be appreciated....
2009 Sep 17
1
Load Error Using Mechanize Gem
...t sure if there are missing gems, and if so, what to install. Any ideas how to fix this? Thanks very much. Gary M. Program -- main.rb: ---------------------- ## Google require ''rubygems'' require ''mechanize'' a = WWW::Mechanize.new { |agent| agent.user_agent_alias = ''Mac Safari'' } a.get(''http://google.com/'') do |page| search_result = page.form_with(:name => ''f'') do |search| search.q = ''Hello world'' end.submit search_result.links.each do |link| puts link....
2007 Jan 12
0
why dose to_absolute_uri use URI.escape?
hello. This code is abort with Mechanize 0.6.4 . ---------------------------- # sample.rb require "rubygems" require "mechanize" agent = WWW::Mechanize.new agent.user_agent_alias=''Windows Mozilla'' # top page of wikipedia for japanese agent.get("http://ja.wikipedia.org/wiki/%E3%83%A1%E3%82%A4%E3%83%B3%E3%83%9A%E3%83%BC%E3%82%B8") ----------------------------- > ruby sample.rb ruby sample.rb C:/opt/ruby-1.8/lib/ruby/1.8/uri/common.rb:432:in `s...
2012 Dec 19
0
(no subject)
hello, I have a problem, I want to do is get a certificate .p12, I am implementing the following code: m= Mechanize.new m.log = Logger.new "m.log" m.user_agent_alias = "Mac Safari" if RbConfig::CONFIG["host_os"] =~ /mingw|mswin/ ca_path = File.expand_path "C:/Users/amdx3/Desktop/cacert.p12" m.agent.http.ca_file = ca_path end pag = m.get "https://www.newpage.com.mx/login" # the site is only...
2009 Sep 25
0
WWW::Mechanize and Rails console not playing well
...#39;s the code: #!/usr/local/bin/ruby require ''rubygems'' require ''mechanize'' require ''logger'' require ''uri'' require ''net/http'' agent = WWW::Mechanize.new { |a| a.log = Logger.new("mech.log") } agent.user_agent_alias = ''Mac Safari'' page = agent.get(''http://www.fyi.legis.state.tx.us/Address.aspx'') search_form = page.form_with(:name => "AddressForm") search_form.field_with(:name => "Address1").value = "501 W 26th St, Apt 110" search_form.fie...
2007 Nov 12
3
Weird error downloading a gzip''ed file
...p the excellent work. ---- msn-scrap.rb---- #!/usr/bin/env ruby # download msn contacts require ''rubygems'' require ''mechanize'' require ''logger'' begin agent = WWW::Mechanize.new { |a| a.log = Logger.new("mech.log") } agent.user_agent_alias = "Windows IE 6" page = agent.get("https://login.live.com/login.srf") form = page.forms.name("f1").first form.login = ''user'' form.passwd = ''pass'' page = agent.submit(form) pageContact = agent.get('...
2007 May 20
0
Urgent :: File Object problem
...a member section * See workflow section at the end of script for detail * (c)2007 onlinesigns.com =end #Set up the agent agent = WWW::Mechanize.new #Ignore these line if not using a proxy #agent.set_proxy(''192.168.85.2'', ''80'') #agent.read_timeout=10000 #agent.user_agent_alias = ''Mac Safari'' page = agent.get("http://www.realtor.org/nrdslogi.nsf/LoginUserInfo") login_form = page.forms.with.name("__TraceLogin").first if login_form == nil puts "The Realtor site is not available at the moment!!!" else #1. Login to Realto...
2006 Dec 07
6
Response To Form Submission Hanging
Hello, I am using Mechanize to post a form to a website. When I do this by hand in my browser the response takes about 35s to come back (it''s a long page full of tables and graphics). When I do this with Mechanize, the server starts to respond and then appears to hang. The obvious conclusion is that my code is wrong but I am reasonably sure that I haven''t altered it
2010 Oct 20
2
Mechanize::ResponseCodeError: 500
Also, excuse me if my issue is a little bit application-specific. I need Mechanize to submit bunch of data from our server to an online reservation system. The url ishttp://hajres.iranair.com/haj/request.php" It works in my browser however, using mechanize following error appears: >> agent.get("http://hajres.iranair.com/haj/request.php") Net::HTTP::Get: /haj/request.php
2010 Jan 25
4
Does Amazon.com blocks scraping?
Hi there Does anyone know if Amazon.com has any sort of server side script that tries to block scraping activities? I first noticed that if I didn?t change the agent alias, it would fetch a page exactly like the normal one, but without the intial search field(maybe a silly way to prevent scraping). Then after it, I changed to some other alias, and submit a search. I got the result page as
2007 Feb 07
15
https with certificates
I poked around the web a little and didn''t run across how to use https when it asks for certificate validation. I''m trying to connect to devices that don''t have valid certificates, and in this case, I don''t care if they are or not. So when I use my browser to ge to the site, firefox asks me to allow the certificate, then one other question, then I get the