Scraping Page Data

Results 1 to 2 of 2

Thread: Scraping Page Data

  1. #1
    Join Date
    Dec 1969

    Default Scraping Page Data

    I&#039;m using the following ASP page to &#039;scrape&#039; data from another page... The ASP page passes form data and get request parameters to another page and returns the results. Kind of acting like a proxy... I want to be able to insert additional data when the request method is a post... for example another variable that is added by the proxy. Any ideas?<BR><BR>&#060;%@language=JScript%&#062;<BR>& #060;%<BR> var objSrvHTTP=Server.CreateObject("MSXML2.ServerXMLHT TP");<BR> var url="http://localhost:8080/myotherdatasource"<BR><BR> if (Request.ServerVariables("REQUEST_METHOD")=="POST" ) {<BR> var DataToSend = Request.BinaryRead(Request.TotalBytes);<BR>"POST",url,false);<BR><BR>objSrvHT TP.setRequestHeader("Content-type","application/x-www-form-urlenco<BR>ded");<BR><BR> // additional logic here<BR><BR> objSrvHTTP.send(DataToSend);<BR> } else {<BR><BR>"GET",url+"?"+Request.Ser verVariables("QUERY_STRING"),fals<BR>e);<BR> objSrvHTTP.send();<BR> }<BR> Response.Write(objSrvHTTP.responseText);<BR>%&#062 ;<BR><BR>In the part that I have &#039;additional logic here&#039; I want to forward another<BR>Form field. The form field would look like: "authcode=9230151"<BR><BR>Cliff.<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Scraping Page Data

    Send the querystring using the Send statement.<BR>&#060;%<BR>var strPostData = "ExtraField=" + Test + "&ExtraField2=" + Test2;<BR>"POST",url,false);<BR>ob jSrvHTTP.Open ("POST", "", 0) <BR>objSrvHTTP.Send(strPostData)<BR>Response.Write (objSrvHTTP.responseText);<BR>%&#062;<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts