Avatar of sid007i
sid007iFlag for United States of America asked on

In ASP using VBScript do a get using a URL and get the webpage

In an ASP page how would I do a get and 'get' the page  based on the URL.

Basically if I did google.com I was google.com to display on the page. If I entered a URL search string for: http://www.google.com/search?hl=en&q=experts+exchange I want that page outputed to the browser.
I had a code that did this but lost it :/
Anyone?
ASPVB Script

Avatar of undefined
Last Comment
hielo

8/22/2022 - Mon
hielo

Try
function getPage(sourceURL)
  set xmlServerHttp = server.createObject("MSXML2.ServerXMLHTTP.4.0")
  xmlServerHttp.Open "GET", sourceURL, False
  getPage = xmlServerHttp.responsetext
  Set xmlServerHttp = Nothing
end function 
mydata = getPage("http://www.somesite.com/login.jsp" )
Response.Write(mydata)
 

Open in new window

ASKER
sid007i

That shoud work however I keep getting:
msxml4.dll error 'c00c023f'
This method cannot be called until the send method has been called.
/testing/asp.asp, line 4
which is:   getPage = xmlServerHttp.responsetext

Thoughts?
ASKER CERTIFIED SOLUTION
hielo

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
sid007i

Thanks!
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
hielo

You are welcome!