Logo 
Search:

Asp.net Forum

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds

screen scraping with https

  Asked By: Kelley    Date: Jun 17    Category: Asp.net    Views: 1007
  

Has anybody been able to successfully POST data to a https and get
the return via webrequest - all works well with an http but with
https - the POST doesn't appear to work properly?

Share: 

 

3 Answers Found

 
Answer #1    Answered By: Edwin Chavez     Answered On: Jun 17

Show us the code you tried and tell us the exact error meassge......

 
Answer #2    Answered By: Burk Martin     Answered On: Jun 17

Here is the code: the uri is an https  - no error - the server I am
posting to simply says that there are no parameters being passed and
that causes the program on their end to return  no data.

Function readHtmlPage(ByVal url As String, ByVal stufftopost As
String) As String
Dim proxyObject As WebProxy
proxyObject = New WebProxy("xxx.xxx.xxx.xxx", 8080)
proxyObject.BypassProxyOnLocal = True
GlobalProxySelection.Select = proxyObject

Dim cert As X509Certificate
cert = X509Certificate.CreateFromCertFile("c:\fdcert.cer")

Dim result As String = ""
Dim strPost As String = stufftopost
Dim myWriter As StreamWriter

Dim url2 As String
url2 = url & stufftopost
Dim objRequest As HttpWebRequest = WebRequest.Create(url)
objRequest.ClientCertificates.Add(cert)
objRequest.Method = "POST"
objRequest.ContentLength = strPost.Length
objRequest.ContentType = "application/x-www-form-urlencoded"

Try
myWriter = New StreamWriter(objRequest.GetRequestStream
())
myWriter.Write(strPost)
Catch e As Exception
Return e.Message
Finally
myWriter.Close()
End Try

Dim objResponse As HttpWebResponse = objRequest.GetResponse()
Dim sr As StreamReader
sr = New StreamReader(objResponse.GetResponseStream())
result = sr.ReadToEnd()
sr.Close()

 
Answer #3    Answered By: Hubert Taylor     Answered On: Jun 17

I'm not sure how helpful this will be with your situation... but I came
across a quick-tip today that might help you with this problem..

www.digitalvideotoolbox.com/.../ShowQuestion.aspx

I used it to grab the html from an https  webpage (my bank's login page) and
it returned the source successfully.

 
Didn't find what you were looking for? Find more on screen scraping with https Or get search suggestion and latest updates.




Tagged: