[Ironruby-core] Accessing open-uri from the same directory

Ivan Porto Carrero ivan at flanders.co.nz
Wed Jun 17 10:48:18 EDT 2009


if you have openuri required
just remove the File that should work
or

uri = URI.parse("http://somewhere.com/default.aspx")
uri.open do |f|
  #some logic here
end

or

you could just use

open("http://somewhere.com/default.aspx") do |f|
   # some logic here
end

taken from
http://www.ruby-doc.org/stdlib/libdoc/open-uri/rdoc/classes/OpenURI.html
---
Met vriendelijke groeten - Best regards - Salutations
Ivan Porto Carrero
Blog: http://flanders.co.nz
Twitter: http://twitter.com/casualjim
Author of IronRuby in Action (http://manning.com/carrero)



On Wed, Jun 17, 2009 at 4:34 PM, Mohammad Azam <lists at ruby-forum.com> wrote:

>
> I am using the following code to scrape the webpage.
>
> button = Button.new
> button.Text = 'Scrape URL'
> button.Location = System::Drawing::Point.new(108,61)
> button.click  do |sender,args|
>
>  page = File.open("http://www.azamsharp.com/Default.aspx")
>  System::Windows::Forms::MessageBox.Show(page.read)
>
> end
>
> I get the following error message:
>
> Invalid argument - URI formats are not supported
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20090617/c0ad9504/attachment.html>


More information about the Ironruby-core mailing list