Hi Ethan,

Thanks for the response on this. I ended up writing a simple proxy which I 
point watir at and saves *everything* down as it goes. It's been working out 
great.

Thanks 
Brendan

On Apr 14, 2010, at 5:27 PM, Ethan wrote:

> It looks like you have the watir part down. It's easy to download data from a 
> URL in ruby, though not through watir. Check the Net::HTTP library. 
> http://www.ruby-doc.org/core/classes/Net/HTTP.html
> If the <script>'s src attribute is set to a relative path then you'll have to 
> combine it with the page's url to get an absolute path, but that shouldn't be 
> too hard. 
> 
> On Wed, Apr 14, 2010 at 17:12, Brendan Grainger <brendan.grain...@gmail.com> 
> wrote:
> Hi Tiffany,
> 
> I realize water is a ruby library that interacts with web browsers. I also 
> realize it's easy to enumerate all the linked script files with something 
> like:
> 
> jscripts = ie.document.getElementsTagName("script")
> jscripts.each do |js|
>        puts "Javascript file is located at: #{js.invoke('src')}"
>        #Easy way to download javascript file? I could do this I guess:
>        javascritpt_content = ie.goto(js.invoke('src')).html # Obviously have 
> to account for relative urls here....
> end
> 
> I was wondering more if there was a built in way.
> 
> Thanks anyway
> Brendan
> 
> On Apr 14, 2010, at 3:07 PM, Tiffany Fodor wrote:
> 
> > Hi!
> >
> > Watir is a Ruby library that allows users to interact with web
> > browsers.  There's a good chance that you could accomplish your file
> > management with Ruby, but that is a question for a Ruby mailing list
> > (http://www.ruby-lang.org/en/community/mailing-lists/).
> >
> > Good luck!
> >
> > -Tiffany
> >
> > On Apr 12, 10:33 pm, rainkinz <brendan.grain...@gmail.com> wrote:
> >> Hi,
> >>
> >> Is there an easy way to enumerate and save javascript files (and
> >> linked css files for that matter) using watir?
> >>
> >> Thanks
> >
> > --
> > Before posting, please read http://watir.com/support. In short: search 
> > before you ask, be nice.
> >
> > You received this message because you are subscribed to 
> > http://groups.google.com/group/watir-general
> > To post: watir-general@googlegroups.com
> >
> > To unsubscribe, reply using "remove me" as the subject.
> 
> --
> Before posting, please read http://watir.com/support. In short: search before 
> you ask, be nice.
> 
> You received this message because you are subscribed to 
> http://groups.google.com/group/watir-general
> To post: watir-general@googlegroups.com
> 
> 
> -- 
> Before posting, please read http://watir.com/support. In short: search before 
> you ask, be nice.
>  
> You received this message because you are subscribed to 
> http://groups.google.com/group/watir-general
> To post: watir-general@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com

Reply via email to