A
anne001
I would like to open and save to disk https tutorials which were
created with Flash i think.
To simplify, I login to the site with a webbrowser, so I don't need to
access a form. Just pages with links to the tutorials.
mechanize seems the tool to use from what I found out. I tried this
code found on this list:
require 'net/https'
require 'uri'
class HTTPS < Net::HTTP
def initialize *a, &b
super
self.use_ssl = true
self.verify_mode = OpenSSL::SSL::VERIFY_NONE
self.set_debug_output $stderr
end
end
# the url is of the form
url = 'https://tutorials.siteofinterest.com/?page=tutorialView&tId=47'
uri = URI.parse url
HTTPS.start(uri.host, uri.port) do |https|
response = https.post("#{uri.path}?#{uri.query}")
puts response.body
end
-----error message --->
opening connection to tutorials.siteofinterest.com...
opened
opurl2.rb:18:in `post': wrong number of arguments (1 for 2)
(ArgumentError)
I checked with IRB, uri seems to do its parsing, finding the host, the
path and the arguments after the question mark.
How can I find out what the second argument is that I need to put in?
or How can I find out what post Safari sends when I click on the same
link?
created with Flash i think.
To simplify, I login to the site with a webbrowser, so I don't need to
access a form. Just pages with links to the tutorials.
mechanize seems the tool to use from what I found out. I tried this
code found on this list:
require 'net/https'
require 'uri'
class HTTPS < Net::HTTP
def initialize *a, &b
super
self.use_ssl = true
self.verify_mode = OpenSSL::SSL::VERIFY_NONE
self.set_debug_output $stderr
end
end
# the url is of the form
url = 'https://tutorials.siteofinterest.com/?page=tutorialView&tId=47'
uri = URI.parse url
HTTPS.start(uri.host, uri.port) do |https|
response = https.post("#{uri.path}?#{uri.query}")
puts response.body
end
-----error message --->
opening connection to tutorials.siteofinterest.com...
opened
opurl2.rb:18:in `post': wrong number of arguments (1 for 2)
(ArgumentError)
I checked with IRB, uri seems to do its parsing, finding the host, the
path and the arguments after the question mark.
How can I find out what the second argument is that I need to put in?
or How can I find out what post Safari sends when I click on the same
link?