<***@gmail.com> wrote
| You can do below way
|
| Set ie = createobject("internetexplorer.application")
| Ie.navigate = "yahoo.com"
| Do while ie.readystate<>4 :wscript.sleep(100):loop
| X=IE.document.body.innertext
| Set wsh= createobject ("wscript.shell")
| Set clip = wsh.exec("clip")
| Clip.stdin.write (X)
You have numerous errors there. Obviously you never
tried your own code. And why would you want to
transfer webpage text to a console window?
Errors: IE.Navigate is not a property but a method.
There's no "=". document.body only works for quirks mode.
WSHShell is not necessary. You should call Quit on IE
when you're done. It's an application object that runs
in its own process. It doesn't die with your script.
'------------------ begin script ---------------
Dim IE, s1, Ret
Set IE = CreateObject("InternetExplorer.Application")
IE.Navigate "C:\windows\desktop\test.html"
Do While IE.ReadyState <> 4
WScript.sleep(100)
Loop
If IE.document.compatMode = "CSS1Compat" Then
s1 = IE.document.documentElement.innerText
Else
s1 = IE.document.body.innerText
End If
Ret = IE.document.parentWindow.clipboardData.setData("Text", s1)
IE.Quit
Set IE = Nothing
' You should now be able to paste the text of the webpage
' to notepad to test that it worked. Or if you have some odd
' reason to use a DOS window then you can try to paste it
' there. :)