Not sure I've posted this in the right place but here's the problem.
I've made some progress but I'm stuck. I can find and use the data in a
required cookie and send it in the httprequest as hard-coded for a test. Of
course I need this to be part of the automated request process as if I was
using a
browser. Surely there is a method to automatically find the cookie, extract
the right property and make this happen? I can't find it.
Scenario:
Website uri is http://www.pageiwant.com.
Page I want is http://www.pageiwant.com/here?.php?m=meetup
I have logged in via browser and cookie is set
Cookie is C:\Docs\Own\Cooks\ow***@www.pageiwant[1].txt
Property I want in cookie is ABCD (cookie.name)which has been set to
G7789Ooqdowjkc7rrFA28r5hp0f78e (cookie.value) when the browser was used to
log in to website.
Here is my test code that does the job:
Dim uri As New Uri("http://www.pageiwant.com/here?.php?m=meetup")
Dim cookUri As New Uri("http://www.pageiwant.com")
Dim request As HttpWebRequest
Dim response As HttpWebResponse
Try
request = CType(WebRequest.Create(uri), HttpWebRequest)
request.CookieContainer = New CookieContainer
request.CookieContainer.SetCookies(cookUri,
"ABCD=G7789Ooqdowjkc7rrFA28r5hp0f78e")
'Rest of code goes here
The above authenticates me using the cookie value as if I was using a
browser. What is the best way to automate this for any client machine. There
must be a way :)
TIA
JD/Simon