Thanks for response I am still having some problems now its the 403. Manually I can login with no probems, but there is a popup page to enter username and password. How do I process the username popup? <br><br>require 'mechanize'
<br>require 'logger'<br><br> <br>CP_LOGGER = Logger.new( 'cp.log' )<br><br>CP_LOGGER.level = Logger::INFO<br><br> agent = WWW::Mechanize.new {|a| a.log = Logger.new(STDERR) }<br> <br> agent.basic_auth('username', 'password')
<br> <br> page = agent.get('https://' ) <br> <br><br>>ruby mechanize_altell.rb<br>I, [2007-07-12T12:42:11.718000 #400] INFO -- : Net::HTTP::Get: /developer/<br>D, [2007-07-12T12:42:13.375000 #400] DEBUG -- : request-header: accept-language => en-us,en;q0.5
<br>D, [2007-07-12T12:42:13.375000 #400] DEBUG -- : request-header: connection => keep-alive<br>D, [2007-07-12T12:42:13.375000 #400] DEBUG -- : request-header: accept => */*<br>D, [2007-07-12T12:42:13.375000 #400] DEBUG -- : request-header: accept-encoding => gzip,identity
<br>D, [2007-07-12T12:42:13.375000 #400] DEBUG -- : request-header: user-agent => WWW-Mechanize/0.6.8 (<a href="http://rubyforge.org/projects/mechanize/">http://rubyforge.org/projects/mechanize/</a>)<br>D, [2007-07-12T12:42:
13.375000 #400] DEBUG -- : request-header: authorization => Basic anl1QGdvdHZuZXR3b3Jrcy5jb206Z290dnJvY2tz<br>D, [2007-07-12T12:42:13.375000 #400] DEBUG -- : request-header: accept-charset => ISO-8859-1,utf-8;q=0.7,*;q=
0.7<br>D, [2007-07-12T12:42:13.375000 #400] DEBUG -- : request-header: keep-alive => 300<br>D, [2007-07-12T12:42:13.515000 #400] DEBUG -- : Read 0 bytes<br>D, [2007-07-12T12:42:13.515000 #400] DEBUG -- : Read 726 bytes
<br>D, [2007-07-12T12:42:13.515000 #400] DEBUG -- : response-header: connection => Keep-Alive<br>D, [2007-07-12T12:42:13.515000 #400] DEBUG -- : response-header: content-type => text/html; charset=iso-8859-1<br>D, [2007-07-12T12:42:
13.515000 #400] DEBUG -- : response-header: date => Thu, 12 Jul 2007 19:42:20 GMT<br>D, [2007-07-12T12:42:13.515000 #400] DEBUG -- : response-header: server => IBM_HTTP_Server<br>D, [2007-07-12T12:42:13.515000 #400] DEBUG -- : response-header: content-length => 726
<br>D, [2007-07-12T12:42:13.515000 #400] DEBUG -- : response-header: keep-alive => timeout=10, max=100<br>I, [2007-07-12T12:42:13.531000 #400] INFO -- : status: 403<br>c:/ruby/lib/ruby/gems/1.8/gems/mechanize-0.6.8/lib/mechanize.rb:172:in `get': 403 => Net::HTTPForbidden (WWW::Mechanize::ResponseCodeError)
<br> from mechanize_altell.rb:13<br>>Exit code: 1<br><br><div><span class="gmail_quote">On 7/11/07, <b class="gmail_sendername">Aaron Patterson</b> <<a href="mailto:aaron@tenderlovemaking.com">aaron@tenderlovemaking.com
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Wed, Jul 11, 2007 at 07:47:58PM -0700, jeffrey mclurkin wrote:<br>> How do you make get the page when using basic_auth? Below is code, I am
<br>> getting a 401 error. I am not sure if the basic _auth comes before the<br>> agent.get. I will appreciate any help.<br><br>Make sure to do it before the get.<br><br>Hope that helps!<br><br>--<br>Aaron Patterson
<br><a href="http://tenderlovemaking.com/">http://tenderlovemaking.com/</a><br>_______________________________________________<br>Mechanize-users mailing list<br><a href="mailto:Mechanize-users@rubyforge.org">Mechanize-users@rubyforge.org
</a><br><a href="http://rubyforge.org/mailman/listinfo/mechanize-users">http://rubyforge.org/mailman/listinfo/mechanize-users</a><br></blockquote></div><br>