sdatla
asked on
Need help in launching URL in VBScript and save the contents to a file
I need to launch URL using vbscript and save the contents of URL to a text file. I don't want to copy the clipboard to copy and paste
the content as it takes long time.
I tried using the below code to launch URL. it doesn't work. Do i need some xml version MSXML to be installed to launch the web page?
cURL = "http://www.google.com"
Dim objXML
'* Set objXML = CreateObject("MSXML2.XMLHT TP")
Set objXML = CreateObject("Microsoft.XM LHTTP")
objXML.Open "GET", cURL, False
objXML.Send
strXML = objXML.ResponseText
Set objXML = Nothing
I don't know how to save the web page to a text file. Please help me.
the content as it takes long time.
I tried using the below code to launch URL. it doesn't work. Do i need some xml version MSXML to be installed to launch the web page?
cURL = "http://www.google.com"
Dim objXML
'* Set objXML = CreateObject("MSXML2.XMLHT
Set objXML = CreateObject("Microsoft.XM
objXML.Open "GET", cURL, False
objXML.Send
strXML = objXML.ResponseText
Set objXML = Nothing
I don't know how to save the web page to a text file. Please help me.
ASKER
I tried using this code.
At line 12, i got Access denied. (msxml3.dll)
i attached the screenshot. Please help.
Thank you.
msxml3-error.bmp
At line 12, i got Access denied. (msxml3.dll)
i attached the screenshot. Please help.
Thank you.
msxml3-error.bmp
sorry the screenshot is blank?
ASKER
This is the error i got.
Script: test. vbs
Line:12
Char 3
Error: Access Denied
Error: 80070005
Source:msxml3.dll
Script: test. vbs
Line:12
Char 3
Error: Access Denied
Error: 80070005
Source:msxml3.dll
ASKER
There was some info on Google about this error code. It said it is because of the corrupted registry files and recommed solution is to install some Repair utility. I tried installling that and in order to fix it, it asked me to purchase the license. I could not go further on that. I am using IE8 browser.
I tested on another machine which has IE8 and it has got the same error. I don't think it is something with the corrupted files. Please help.
Thanks
I tested on another machine which has IE8 and it has got the same error. I don't think it is something with the corrupted files. Please help.
Thanks
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks for your reply. I could run the script.
I have one question. When the script ran, it didn't launch the URL for me to see which URL it ran, but It did write the source to the file. (Thank you). Does the "Get" method launch the URL? I could get the output. It wrote the source code to the text file (With the html tags and functions). I want to write the web page content (the content on the page which appears in plain text) to the file. Can you help me with that?
Thank you.
I have one question. When the script ran, it didn't launch the URL for me to see which URL it ran, but It did write the source to the file. (Thank you). Does the "Get" method launch the URL? I could get the output. It wrote the source code to the text file (With the html tags and functions). I want to write the web page content (the content on the page which appears in plain text) to the file. Can you help me with that?
Thank you.
It could be done, but it probably wont turn out how you would want, as html tells the webbrowser how to display the page.
can you give an example url that you would like?
can you give an example url that you would like?
ASKER
I have one intranet URL but the url would be anything (http://www.w3schools.com).
I can manage with that or remove the tags. Just trying to see if i can get the plain text. I am fine with it.
i will accept the solution once i get reply from you.
I can manage with that or remove the tags. Just trying to see if i can get the plain text. I am fine with it.
i will accept the solution once i get reply from you.
it would probably be best to leave the html as removing it can make the file all jumbled
Open in new window