473,395 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to login yahoo finance

I need how to log in Yahoo finance through VB.NET code to fetch the real time stock market data here I am posting some code through which I am download data from yahoo but this is not real time data only I will get real time data after log in to yahoo finance
Expand|Select|Wrap|Line Numbers
  1. Imports System
  2. Imports System.IO
  3. Imports System.Net
  4. Imports System.Text
  5.  
  6. Public Class Form1
  7.  
  8.  
  9.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  10.  
  11.         Dim symbol As [String] = txtQuotes.Text
  12.  
  13.         Dim request As HttpWebRequest
  14.         Dim response As HttpWebResponse = Nothing
  15.         Dim reader As StreamReader
  16.  
  17.         Try
  18.  
  19.             ''request = WebRequest.Create("http://finance.yahoo.com/d/quotes.csv?s=Reliance.ns&f=sl1d1t1c1ohgv&e=.csv")
  20.  
  21.             'request = WebRequest.Create("http://quote.yahoo.com/d/quotes.csv?s=Reliance.ns&f=sl1d1t1c1ohgv&e=.csv")
  22.  
  23.             request = WebRequest.Create("http://finance.yahoo.com/d/quotes.csv?s=" & symbol & "&f=sl1d1t1c1ohgv&e=.csv")
  24.             request.Method = "POST"
  25.             ' Get response 
  26.             request.ContentType = "text/xml"
  27.             ''request.Headers.Add("SOAPAction", "http://finance.yahoo.com/d/quotes.csv?s=Reliance.ns&f=sl1d1t1c1ohgv&e=.csv")
  28.  
  29.             request.Headers.Add("SOAPAction", "http://finance.yahoo.com/d/quotes.csv?s=" & symbol & "&f=sl1d1t1c1ohgv&e=.csv")
  30.  
  31.             'request.Headers.Add("SOAPAction", "http://quote.yahoo.com/d/quotes.csv?s=Reliance.ns&f=sl1d1t1c1ohgv&e=.csv")
  32.             response = DirectCast(request.GetResponse(), HttpWebResponse)
  33.  
  34.             reader = New StreamReader(response.GetResponseStream())
  35.             txtOutput1.Text = (reader.ReadToEnd())
  36.  
  37.         Finally
  38.             If Not response Is Nothing Then response.Close()
  39.         End Try
  40.     End Sub
  41.  
  42.     Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  43.         Dim s As String() = txtOutput1.Text.Split(",")
  44.         Dim word As String
  45.         'Dim dv As DataGridViewRow
  46.         Dim dgvRow As New DataGridViewRow
  47.         For Each word In s
  48.  
  49.             Dim dgvCell As DataGridViewCell
  50.  
  51.             dgvCell = New DataGridViewTextBoxCell()
  52.             dgvCell.Value = word
  53.  
  54.             dgvRow.Cells.Add(dgvCell)
  55.             'dg1.Columns.Add("Column Name", "Column Heading")
  56.  
  57.  
  58.         Next
  59.         dg1.Rows.Add(dgvRow)
  60.  
  61.     End Sub
  62. End Class
Aug 6 '11 #1
1 3229
Does your code actually log you into Yahoo for the real time data? As it stands, you're just reading (as you say), the static data - however, you're not actually doing anything with it.

Button1 does the connection and outputs the stream, Button3 looks to add data to a grid, but there is no connection between them.

I don't know if yahoo connects in the same way as gmail, but this may help (sorry, it's in C#, but easily ported over)

http://www.all-the-johnsons.co.uk/csharp/email.html

PFJ
Aug 8 '11 #2

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

Similar topics

2
by: bryce21 | last post by:
I'm trying to write a script that logs into Yahoo Fantasy Football. Once logged in, I'll be able to grab stats and various other pieces of info about our league. The problem I'm having deals with...
6
by: f | last post by:
I am writing an app in which I need to get the stock quote from Yahoo. Idealy, I will get a stream from Yahoo's web site and parse that as string and display the information (price, PE, volumn...)....
13
by: dan roberts | last post by:
Folks, This is my first Python project so please bear with me. I need to download data from Yahoo Finance in CSV format. The symbols are provided in a text file, and the project details are...
4
by: joe_public34 | last post by:
Hello all, I'm trying to write a script to log into Yahoo! (mail, groups, etc), but when I pass the full URL with all form elements via Python, I get a resutling 400 - Bad Request page. When I...
1
by: Andrew | last post by:
Hello, friends, I am implementing web app security using asp.net 1.1, and I found the following source code from Yahoo! Mail login page: <form method="post"...
2
by: James | last post by:
Is there a way to get a list of stock quotes from yahoo finance into you c# application? I looked on the yahoo finance page and cannot see a wsdl end point. Can somebody please point me in the...
0
by: admin | last post by:
biz.yahoo.com/prnews/070219/sfm012a.html?.v=1 Microsoft Corp. today released Microsoft® SQL Server 2005 SP2, an update to its award-winning data management and analysis platform. Customers can...
0
by: cmrodrig | last post by:
For a long time, I've been looking for a solution to this error. There are some reports to Yahoo support, but none could solve this problem. It happens when we try to open Java charts on Yahoo...
0
by: =?Utf-8?B?Unlhbg==?= | last post by:
Dear Sir/Madam, When I try to login email account in Yahoo, the following message is received in the next tab. Affterwards, the next tab ask me to re-enter the login name and password, however,...
1
by: lucky che | last post by:
i am new to curl .and i m trying to create create a script for my client to log into yahoo and click the confirmation link in emails. but i am stuck witht he login process only i made the code...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.