Link to home
Start Free TrialLog in
Avatar of drcyrus
drcyrus

asked on

How can i login to yahoo from vb.net (using the WebClient Class)???

Hy,

I want to make an apllication in vb.net that send's through the POST method the user and pass to the yahoo page and returns me into a text box the link to my inbox.

Any ideas.
Thanks.
Avatar of Kavar
Kavar

use the Internet Explorer object

...vbscript here

dim ie
set ie=createobject("InternetExplorer.application")
ie.visible=true
ie.navigate2 "www.yahoo.com"
do while ie.busy=true
wscript.sleep 10
loop

ie.document.all("<name of yahoo username control>").value=username
ie.document.all("<name of yahoo password control>").value=password
ie.document.all("name of yahoo form").post

Do while ie.busy=true
 wscript.sleep 10
loop
wscript.echo ie.document.all("control name with info you want").value
Avatar of Éric Moreau
What do you want to get from Yahoo?
Avatar of drcyrus

ASKER

Hy emoreau,

I have a portfolio up on Yahoo finance, and i've haded with all the click's i have to make to get to my portofolio. I want to make this application in vb.net to pass yahoo login with my user/pass and go to the desired page. I know how to make the rest of the app but i'm stuck at the login part.

I need an example on how to post my user/pass on the page and how to get the resulting page.

Thanks.
give me the url I can give you the code
You need to use Kavar solution.
Avatar of drcyrus

ASKER

Hy Kavar,

I need a pure vb.net code no scripting languages. If you have a solution for me you can send me the code to my mail: {{removed per http:/help.jsp#hi99 -- DanRollins/EE PE}}

I'll stick around to see your response.

Thanks.
I can, but I need the url to pull the control names off the web page
Avatar of drcyrus

ASKER

Here you can find the login page for Yahoo Finanace: http://finance.yahoo.com/?u
After you click the sign in button you will be redirected to this link: http://login.yahoo.com/config/login?.src=quote&.intl=us&.done=
After you sign in in the searchbox enter QCOM and it will send you to another page. That's all that interests me.

Thanks.

ASKER CERTIFIED SOLUTION
Avatar of Kavar
Kavar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I dont have a valid login so I dont know what control to pass the "QCOM" to....
Avatar of drcyrus

ASKER

what class do i have to import to be able to use these?
SHDocVw.InternetExplorer
mshtml.HTMLDocument
can you give me an example on how to use this?

Dim web As New System.Net.WebClient()
web.UploadData("http://abstractvb.com/search.asp", "POST", d)
but to POST the user and password too??
use the code I sent you, to get past the login, just include the reference for

SHDocVw
Microsoft.mshtml

If you need to figure out how to get past the page AFTER the login page, I need the source for the page after login.  you can email me that if you feel its confidential
Avatar of drcyrus

ASKER

Give your mail. So i can send you the resulting page source code.
In the code you gave me these 2 are not recognized:
Type 'SHDocVw.InternetExplorer' is not defined.
Type 'mshtml.HTMLDocument' is not defined.
Give me some more detail. Thanks.
planetsmasher@cdibb.net

on the references tab (Project-> add reference)

find
mshtml.HTMLDocument
and
SHDocVw.InternetExplorer

Click add on each one so they show up in the bottom pane
Let me know if you need more :)
this link will show you how to reference the SHDocVW dll - then referencing mshtml is virtually the same - i think you should use the COM version.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dninvbs/html/usinginternetexplorerobjects.asp
having a strange one... SHDocVw.InternetExplorer reference is fine it passes it and goes to the next line...
having problems referencing mshtml.HTMLDocument...

Dim doc As microsoft.mshtml.HTMLDocument
OR
Dim doc As mshtml.HTMLDocument

both give 'is not defined' error
both mshtml and microsoft.mshtml are being referenced...

any ideas ?
>>any ideas ?

Yes. Ask your own question. Using the threads already posted in EE is a violation of the rules and missusage of the points system...
anyone ever call you petulant? (dont tell me they call you the last bastion of goodness :p)

the question i ask is in direct relation to the post regarded as the answer - i.e. pointing out that it doesn't work! i.e. the answer did not provide a suitable explanation for several areas.

eh? "Using the threads already posted in EE is a violation of the rules and missusage of the points system"

but i often 'use' the threads - you mean no-one should be posting anything? ever?!?!? really!?!?
Hy there,

I used the code that i got from KAVAR and i modified it. It was the best solution at that time.

Thanks for your post but the points were already given away. The question was asked on : "03/03/2004" and your first post was on:  07/07/2005.

I decide wich answer is the best for my question.

Thanks a lot for your understanding.
Hi there,

you obviously missunderstand my post; as well as it seems not knowing the content of it, else i cannot think of any logic that would explain your statements above.

You see, the last post you made implied that you were having problems with referencing; yes the Question thread had obviously been answered when i made a post; (BUT NOT CLOSED - theres a big difference there eh - in concept) where i simply tried to help you with referencing your referencing problem (with no intention of expecting points to be reassigned or that the Question thread was still unanswered and therein that i would get awarded it) - as well as anyone else that looks at these pages.

P.S. Some people are just plain.... helpful :p

The truth is out there.
LOL,

sorry... i always understand the things in mirror. Sorry again. :D It's not my first time. Sorry. And thanks for opening my eyes. :D
hehe - your welcome - :)