By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,039 Members | 1,831 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,039 IT Pros & Developers. It's quick & easy.

How to Log In to Yahoo Finance from Form

P: 2
Expand|Select|Wrap|Line Numbers
  1. Private Sub CommandButton2_Click()
  2.     Dim strPost As String
  3.     Dim objHTTP, replyTXT As String
  4.     Dim AuthenticationTicket As String
  5.     AuthenticationTicket = ""
  6.     Set objHTTP = CreateObject("Msxml2.ServerXMLHTTP")
  7.     strPost = "http://finance.yahoo.com/d/quotes.csv?s=^IXIC,^NSEI,Reliance.ns,SBIN.ns&f=sl1d1t1c1ohgv&e=.csv"
  8.  
  9.     'Get authentication ticket:
  10.     objHTTP.Open "GET", strPost, False
  11.     Call objHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
  12.     objHTTP.send ("login=****.com&passwd=******")
  13.     replyTXT = objHTTP.responseText
  14.     TextBox2 = replyTXT
  15. End Sub
Here I am getting stock data but not realtime.
I want to login to yahoo and get realtime stock data but I did't know how to parse cookies

- Use XmlHttp and send a GET request to the login page ("http://login.yahoo.com/config/login")
- This will return the session cookie that we extract and store
- Using the session cookie we POST the username and password to the processlogin page. now we are logged in. Then download through this url( "http://finance.yahoo.com/d/quotes.csv?s=^IXIC,^NSEI,Reliance.ns,SBIN.ns&f=sl1 d1t1c1ohgv&e=.csv")
Dec 8 '11 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.