Dor_K
1
hi,
it seems Mechanize isn’t working well with relative URLs -
the following lines:
agent = WWW::Mechanize.new { |a| a.log = Logger.new(“mech.log”) }
article = agent.get(’/test.html’)
responded with the following error:
c:/instantrails/ruby/lib/ruby/gems/1.8/gems/mechanize-0.4.3/lib/mechanize.rb:183:in
to_absolute_uri' c:/instantrails/ruby/lib/ruby/gems/1.8/gems/mechanize-0.4.3/lib/mechanize.rb:114:in
get’
Dor_K
2
Dor K. wrote:
c:/instantrails/ruby/lib/ruby/gems/1.8/gems/mechanize-0.4.3/lib/mechanize.rb:183:in
to_absolute_uri' c:/instantrails/ruby/lib/ruby/gems/1.8/gems/mechanize-0.4.3/lib/mechanize.rb:114:in
get’
Where have you told it what host to look at?
Dor_K
3
Alex Y. wrote:
Dor K. wrote:
c:/instantrails/ruby/lib/ruby/gems/1.8/gems/mechanize-0.4.3/lib/mechanize.rb:183:in
to_absolute_uri' c:/instantrails/ruby/lib/ruby/gems/1.8/gems/mechanize-0.4.3/lib/mechanize.rb:114:in
get’
Where have you told it what host to look at?
well, i didn’t, where should I?
Dor_K
4
On 5/18/06, Dor K. [email protected] wrote:
–
Posted via http://www.ruby-forum.com/.
agent.get(‘http://google.com’)
#=> #<WWW::Page:0x2de2ae8 …
agent.get(‘/reader’)
#=> #<WWW::Page:0x2de2ae8 …
Otherwise, how would agnet know which host to get ‘/test.html’ from?
Dor_K
5
Dor K. wrote:
Where have you told it what host to look at?
well, i didn’t, where should I?
You can see a Mechanize example here:
–
James B.
“A language that doesn’t affect the way you think about programming is
not worth knowing.”