require 'uri'
my_url=URI::parse(http://www.blah.com/uk/home.asp?variable;)
puts my_url.scheme
puts my_url.host
puts my_url.path
puts my_url.query
You can put together the pieces you need:
#{my_url.scheme}://#{my_url.host}#{my_url.path}
So your code becomes:
require 'watir'
require 'uri'
On Fri, May 1, 2009 at 15:02, ash ashbr...@gmail.com wrote:
I don't really know Ruby yet
And if you want to know what can you do with strings in Ruby (for future
reference):
http://www.ruby-doc.org/core/classes/String.html
Željko
--~--~-~--~~~---~--~~
You
or goto the command line
ri String
ri String#split
Aidy
2009/5/4 Željko Filipin zeljko.fili...@wa-research.ch:
On Fri, May 1, 2009 at 15:02, ash ashbr...@gmail.com wrote:
I don't really know Ruby yet
And if you want to know what can you do with strings in Ruby (for future
reference):
do one thing if you know ruby somewhat
url=ie.url
url_splitted=url.split(?)
puts url_splitted[0] should give you the base url
On Fri, May 1, 2009 at 5:00 PM, ash ashbr...@gmail.com wrote:
Having searched this group, plus the wiki, plus the mail archives I am
still a little confused as to
Spot on, thanks. I don't really know Ruby yet but using your advice I
got it working.
My new code;
require 'watir'
test_site=http://www.blah.com/uk/home.asp?src=ash;
ie = Watir::IE.new
ie.speed = :fast
ie.goto test_site
url=ie.url
url_splitted=url.split(?)
if url_splitted[0] ==