Thanks Bill! Don't I feel stupid? I only went as far as to verify the array contained strings with urls[0] but I never even tried #.chomp :-(
That worked! I'm glad I asked. Thanks again. Brad On Feb 14, 12:33 pm, Bill Agee <billa...@gmail.com> wrote: > I would inspect the strings in your "urls" array, to make sure they're in > the state that you expect. Could be a trailing line separator is still > included in each string. > > IO#readlines preserves newlines, so that would be the first thing I would > check. > > You can just type "urls[0]" in IRB and see if the first string has a > newline, or inspect the entire array with > > require 'pp' > pp urls > > A quick fix might be to use chomp in your navigation loop: > > ff.goto(url.chomp) > > Thanks > Bill > > > > > > > > On Mon, Feb 14, 2011 at 8:16 AM, Brad <bradask...@gmail.com> wrote: > > I have a very simple example that shows FF on the Mac doesn't work the > > same as FF on the PC. > > > I basically just want to read in a list of URLs from a text file and > > goto those sites and do some processing... > > > require 'rubygems' # for mac not included in PC version but here for > > clarification > > require 'firewatir' > > > ff = FireWatir::Firefox.new > > f = File.open(pathToTexFileWithURLS) > > urls = f.readlines > > > urls.each do |url| > > ff.goto(url) > > end > > > MAC ERROR > > /Library/Ruby/Gems/1.8/gems/firewatir-1.7.1/lib/firewatir/ > > jssh_socket.rb:19:in `js_eval': unterminated string literal > > (JsshSocket::JSSyntaxError) > > from /Library/Ruby/Gems/1.8/gems/firewatir-1.7.1/lib/firewatir/ > > firefox.rb:114:in `goto' > > from urls.rb:13 > > from urls.rb:12:in `each' > > from urls.rb:12 > > > This works on the PC and Fails on the MAC. > > > Does anyone know why? > > > Thanks. > > > Brad > > > -- > > Before posting, please readhttp://watir.com/support. In short: search > > before you ask, be nice. > > > watir-general@googlegroups.com > >http://groups.google.com/group/watir-general > > watir-general+unsubscr...@googlegroups.com<http://groups.google.com/group/watir-general%0Awatir-general+unsubscr...> -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com