Monday, November 03, 2008 8:27 PMI need help here I have a program I wrote years ago to login yahoo to send email and recently I tried to use and my logins were failing. The problem is yahoo changed there login URL Structure. If someone can reply with the correct one I will appreciate the help. I have placed a peice of the code below.
Dim LoginPacket As StringLoginPacket = "GET http://login.yahoo.com/config?&login=" & txtLEmail.Text & "&passwd=" & strPass.Trim & " HTTP/1.0" & vbCrLf
LoginPacket = LoginPacket &"Accept: */*" & vbCrLf
LoginPacket = LoginPacket &"Accept: text/html" & vbCrLf & vbCrLf
LoginPacket = LoginPacket
wsTCP.Protocol = OSWINSCK.ProtocolConstants.sckTCPProtocol
Monday, November 10, 2008 7:33 AMCharlieit123 said:
I need help here I have a program I wrote years ago to login yahoo to send email and recently I tried to use and my logins were failing. The problem is yahoo changed there login URL Structure. If someone can reply with the correct one I will appreciate the help.
I hope someone know the available Yahoo login URL Structure and tell you.
However, instead you can use WebBrowser control to automatically login in Yahoo website.
Firstly you need to know web elements(e.g. Username textbox, Password textbox and Sign In button) source html code via viewing source(Right-click on web page -> "View Source" menu item). The following code sample can login in Yahoo successfully. Please take it a try with your username and password.
Prerequisites: Drag&drop WebBrowser1 onto Form1.
Check these similar code samples for detailed instruction:
1. Automatically login in one website (input uername/password and click Login button)
2. Automatically Live search http://www.live.com/ (enter search keyword and click Search button)
Additionally, .NET Framework Networking and Communication is here.
- Marked As Answer by Martin Xie - MSFT Monday, November 10, 2008 7:36 AM
Wednesday, November 04, 2009 6:31 PMDear Mr Martin Xie...
I need your help to use the cookie after successfull login to yahoo.....
I want this cookie in one more web request.... i.e finance.yahoo.com for real time financial data......
I used your above code to login ....
Please help me
Thanks in Advance
Thursday, November 05, 2009 9:28 AM
Here are some tutorials for you to check:
1. Thread "Using same cookies of a WebBrowser control in a WebRequest"
You can transfer the cookies like this:
Dim request As HttpWebRequest = CType(WebRequest.Create (myUri), HttpWebRequest)
request.CookieContainer = New CookieContainer ()
request.CookieContainer.SetCookies (myUri, webBrowser1.Document.Cookie)
2. Play with HttpWebRequest class (which supports cookies)
3. Pop-up page lost session from WebBrowser
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Monday, December 07, 2009 11:59 AMDear Mr Martin XieThanks for your support.I request you to look at this software "myQuotes" at volumedigger.com.He has made it possible - login to Yahoo! using httpget and httppostI could not able to understand how he has done it... please if you can .... please let me knowYes-- your solution is also is a good one but it takes resources and time to load the page and search tags, input id and again click login button, again load successful login page..... little time consuming and resource consumingPlease have a look at the software given above... I hope you can solve itThanks and RegardsSansharam
Tuesday, March 09, 2010 2:08 PMHello,
When I try to use the navigate command from a module, the webBrowser isn't udpating. Here is my code (I use VB .Net Express 2008):
Public Class frmWeb
Private Sub cmdShowWebPage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdShowWebPage.Click
Private Sub frmWeb_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Sub getWebsite(ByVal URL As String)
Please not that the page is correctly loaded at startup and if I put the code directly in the form code (in the click buton event), again teh code works without anyt problem. Only when I call the code from the module, no udpates are being made.
Thank you for any help.
Tuesday, March 09, 2010 2:28 PMHi,
i guess that you somehow using a incorrect url in your textbox.
This works for me:
'Visual Basic 2008 - .net 3.5 - Any CPU Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click getWebsite("www.google.co.uk") End Sub Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load WebB.Navigate("http://www.google.co.uk/") End Sub End Class Module mdlWeb Sub getWebsite(ByVal URL As String) Form1.WebB.Navigate(URL) Form1.WebB.Update() End Sub End Module
If you have got questions about this, just ask.
Mark the thread as answered if the answer helps you. This helps others who have the same problem !
C# to VB.NET: http://www.developerfusion.com/tools/convert/csharp-to-vb/
Thursday, March 24, 2011 10:23 AM
Considering that many developers in this forum ask how to automate a web page via WebBrowser, rotate or flip images, my team has created a code sample for this frequently asked programming task in Microsoft All-In-One Code Framework. You can download the code samples at:
With these code samples, we hope to reduce developers’ efforts in solving the frequently asked
programming tasks. If you have any feedback or suggestions for the code samples, please email us: email@example.com.
The Microsoft All-In-One Code Framework (http://1code.codeplex.com) is a free, centralized code sample library driven by developers' needs. Our goal is to provide typical code samples for all Microsoft development technologies, and reduce developers' efforts in solving typical programming tasks.
Our team listens to developers’ pains in MSDN forums, social media and various developer communities. We write code samples based on developers’ frequently asked programming tasks, and allow developers to download them with a short code sample publishing cycle. Additionally, our team offers a free code sample request service. This service is a proactive way for our developer community to obtain code samples for certain programming tasks directly from Microsoft.
Microsoft All-In-One Code Framework
Monday, September 12, 2011 7:19 AM
i used your code but it doesn't work because yahoo change their html design.
i look at the html code and i see that the <input type="submit .... changed to
<div id='submit'> <button type='submit' id='.save' name='.save' class='primaryCta' tabindex='5'> Sign In </button> </div>
i change your code to
but it doesn't work agian.what is problem?
Saturday, October 15, 2011 9:43 PM1)download OSWINSCK.DLL (http://www.ostrosoft.com/download/oswinsck.zip) 2)unzip oswinsck and copy oswinsck.dll in system32 folder(c:\windows\system32\) 3)goto [start menu]->[Run menu] 4)run this command : regsvr32 OSWINSCK.dll 5)goto to visual studio 2005 or ... 6)create a windows application project 7)goto [project menu]->[add reference]->[browse tab] 8)find and select ur OSWINSCK.DLL to add 9)swap ur codes with following : Dim LoginPacket As String Dim wsTCP As New OSWINSCK.Winsock LoginPacket = "GET http://login.yahoo.com/config?&login=" & "yourEmail@yahoo.com" & "&passwd=" & "yorEmailPass" & " HTTP/1.0" & vbCrLf LoginPacket = LoginPacket & "Accept: */*" & vbCrLf LoginPacket = LoginPacket & "Accept: text/html" & vbCrLf & vbCrLf LoginPacket = LoginPacket wsTCP.Protocol = OSWINSCK.ProtocolConstants.sckTCPProtocol wsTCP.SendData(LoginPacket) ============ if u have question: firstname.lastname@example.org http://mohammadhashemy.blogfa.com Im student of Iran.
Saturday, June 16, 2012 3:45 AM
... the script given is correct except for one word,
theElementCollection = WebBrowser1.Document.GetElementsByTagName("Input")
this element is a button, not an input...
theElementCollection = WebBrowser1.Document.GetElementsByTagName("Button")
that should fix it
Ive used a similar script for almost 3 years, still works
answer = resolved // the.tutorial.geeks