Saving as a file a web page accessed via a form (doesn't work) 
Author Message
 Saving as a file a web page accessed via a form (doesn't work)

Using the InternetExplorer.Application object I'm able to navigate to
a web page, fill out a form, submit it, and then see the page that
results from the form input.  But when I go to save this second web
page as a file, it will only save the first page -- the one with the
form on it that I navigated to at the start.

I've tried using "While oIE.ReadyState <> 4" to make sure that the
second page is completely loaded before I try to save the page, but it
doesn't help.  I've also tried this on three different sites, and get
the same results.

Any suggestions?  Thanks in advance.

Mark Davies

---- Part of the code copied below ---------

Dim oIE, oRange, oWSHShell, oFS, oFile
Set oIE = CreateObject("InternetExplorer.Application")
Set oFS = CreateObject("Scripting.FileSystemObject")
Set oFile = oFS.CreateTextFile("c:\doit.htm")

oIE.Visible = True
oIE.Navigate " http://www.*-*-*.com/ "
While oIE.ReadyState <> 4
Wend

oIE.document.thatform.Item("lastname").Value = "smith"
. . . .
oIE.document.thatform.Item("Submit").Click

While oIE.ReadyState <> 4     ' This should help, right?
Wend

Set oRange = oIE.document.body.createTextRange()
oFile.Write oRange.HtmlText
oFile.Close

---- End of code ---------



Tue, 20 Jan 2004 13:15:03 GMT  
 Saving as a file a web page accessed via a form (doesn't work)

Quote:
> Using the InternetExplorer.Application object I'm able to navigate to
> a web page, fill out a form, submit it, and then see the page that
> results from the form input.  But when I go to save this second web
> page as a file, it will only save the first page -- the one with the
> form on it that I navigated to at the start.

Looks OK to me (and does the job).

Best regards
Johnny Nielsen



Wed, 21 Jan 2004 17:31:21 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. GetObject() in VBScript on web page doesn't work

2. GetObject() in VBScript on web page doesn't work

3. Creating Text File on Client's Local Machine When Accessing Web Default Page

4. Accessing the A: drive from a program launched via a web page

5. VBScript doesn't work with page objects ?

6. VBScript doesn't work with page objects ?

7. Hidden fields in different pages - doesn't work

8. jumping to a web page via form submit

9. pass a form from web page to web page

10. pass a form from web page to web page

11. 'history' command doesn't work

12. Copy Files using FileSystemObject (Doesn't work)

 

 
Powered by phpBB® Forum Software