Hi, I am trying to screenscrape a site. I have managed to do it 
using XMLHTTP and the first pages works fine. The following pages 
(which are browsing through a results recordset) will not work as a 
cookie is set on other sites server which it checks exists, the 
whole thing crashes and comes up with a 'turn on your cookies' 
message.

 The function which does the screenscraping is:

function sendPost(URL,POST)

on error resume next
Set objXML = Server.CreateObject("MSXML2.ServerXMLHTTP")
if err then
        Response.Write("<p>Error: " & err.description & "<p>")
        Response.End
end if

        ' Call the remote machine the request
        objXML.open "POST", URL, false
        objXML.setRequestHeader "Content-Type", "application/x-www-
form-urlencoded"
        objXML.send(POST)
        
        ' return the response
        sendPost = objXML.responseText

        ' clean up
        set objXML = nothing
        
end function

%>
<%Response.Buffer = true %>

I have tried adding the following code in:

clientCookie = "" + Request.Cookies("ASPSESSIONIDCSSBRTRB")
objXML.setRequestHeader "cookie", "ASPSESSIONIDCSSBRTRB=" + 
clientCookie + "; path=/;"

Response.Cookies("ASPSESSIONIDCSSBRTRB") = httpCookie

to try and grab the cookie but not sure where to put it and whether 
it is working. (it still apears with an error)

I have spoken to the guy who programs the other site and he says:

the name of the cookie is set by the server, it changes each
time, for example

ASPSESSIONIDCSSBRTRB=ANDJBDECMEAIGBAGNGJHBNID

ASPSESSIONIDCSSBRTRB=FDCLADECNHGMAJAMLMFGGAEN

I haven't used HTTPXML but you should be able to iterate the cookie
collection and pass it back 
to the server with each request, otherwise you need to use a 
different
component.

PLEASE PLEASE can someone help? 

Thanks..






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to