IE source code

Hi,
i need to open an IE Window and save the index.html ( the source code) of
the shown site to a file. I think this has to be done with Win32API, but I
don’t know how, because I don’t have much experience with Win32API.
Can anyone help me?
Thanks
Tom

Why not just fetch it straight with net/http?

···

Tommy (basti.steiner@web.de) wrote:

Hi,
i need to open an IE Window and save the index.html ( the source code) of
the shown site to a file. I think this has to be done with Win32API, but I
don’t know how, because I don’t have much experience with Win32API.
Can anyone help me?
Thanks
Tom


Eric Hodel - drbrain@segment7.net - http://segment7.net
All messages signed with fingerprint:
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

You can do it with the InternetExplorer.Aplication com server, using win32ole

But how do I get the source code of the .html file then? I have some scripts
running on my page of which I want to see the results. But they only work if
they are executed in an Internet Explorer Window. If I try to get it with
net/http, i can only get the code before it was executed in an Explorer
Window. So does anyone have a suggestion how to get the source code of an
open Explorer Window?

Thanks

“loats205” loats205@aol.com wrote in message
news:20021104191437.04139.00000006@mb-cm.aol.com

You can do it with the InternetExplorer.Aplication com server, using
win32ole

Did you use the correct POST/GET arguments when using net/http?

···

Tommy (basti.steiner@web.de) wrote:

But how do I get the source code of the .html file then? I have some scripts
running on my page of which I want to see the results. But they only work if
they are executed in an Internet Explorer Window. If I try to get it with
net/http, i can only get the code before it was executed in an Explorer
Window. So does anyone have a suggestion how to get the source code of an
open Explorer Window?


Eric Hodel - drbrain@segment7.net - http://segment7.net
All messages signed with fingerprint:
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

I used this one. But this was not executed in an Explorer Window. So the
scripts were not executed.

h = Net::HTTP.new(‘www.blablabla.com’, 80)
resp, data = h.get( /jsindex/, nil)
data.scan(/<img src="(.*?)"/) { |x| f.puts x }
“Eric Hodel” drbrain@segment7.net wrote in message
news:20021106025550.GY34910@segment7.net

When IE (or any other web browser for that matter) makes the
request, it is sending data via an HTTP GET or HTTP POST request.
If you send the correct arguments, you will recieve the data you
are looking for. You want something like this for an HTTP GET
request:

response = nil
body = nil

Net::HTTP.start(‘www.google.com’, 80) { |http|
response, body = http.get(‘/search?q=HTTP+GET’)
}

body.scan(/<img\ssrc=“(.*?)”/i) { |x|
puts x
}

Where q=HTTP+GET is the query string. In the comments for net/http.rb,
there are also instructions for using HTTP POST to send a request.
(starting line 42 in 1.6.7)

You can tell which type of request you need to make by looking at the
source for the page you are coming from, especially the element.

···

Tommy (basti.steiner@web.de) wrote:

I used this one. But this was not executed in an Explorer Window. So the
scripts were not executed.

h = Net::HTTP.new(‘www.blablabla.com’, 80)
resp, data = h.get( /jsindex/, nil)
data.scan(/<img src=“(.*?)”/) { |x| f.puts x }


Eric Hodel - drbrain@segment7.net - http://segment7.net
All messages signed with fingerprint:
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04