Archived

This topic is now archived and is closed to further replies.

yoda5

getting data off a website

Recommended Posts

yoda5    122
I am trying to make a program for a friend that will open a website, either a espn.com or ect.. read off the stats of a certain player so I can score his fantasy football league. I have never done this before and was wondering if anyone had an idea on how to do this. I am using visual basic Thanks guys

Share this post


Link to post
Share on other sites
drslush    122
I did something like that with the winsock API. It''d probably be harder with VB. Maybe there is an HTTP control for VB?

Share this post


Link to post
Share on other sites
Russell    118
Winsock? Use the right tool for the job. There are programs that will do this for you already. wget or curl + grep + sed would do the job very nicely, probably in a single line of code. perl can probably do the same thing via the ''get'' command. I like this shell script better than the C/C++ code you''d have to write. If you wanted to know when cnn.com was last updated, this should do the trick (not tested).
wget www.cnn.com | grep ''Updated'' | sed ''s/^ *//'' | sed ''s/<.*>//g'' 

Of course you''d need the appropriate programs installed (wget, grep, and sed), but they''re free, and open source too.

Share this post


Link to post
Share on other sites
ApochPiQ    23005
Unlike everyone else, I''m not going to tell you to do it in *nix *cough cough*

Under project/components, find the entry Microsoft Internet Controls (filename shdocvw.dll) and check it. Drop the Webbrowser control on your form, set Visible=false, and enjoy.

Share this post


Link to post
Share on other sites
Dobbs    164
Does ESPN consistently publish the stats at the same url, in the same format? If they do it won''t be hard but I''m guessing they don''t. And if they don''t no amount of Unix tools is going to help you. There''s really no way of doing this reliably, short of access to an ESPN Web Service (read my mind Magmai, or maybe I read yours) which they probably don''t have (why would they?).

A quick Google did find this site that offers a Web Service for baseball stats, but nothing for football. Keep hunting I guess.

Share this post


Link to post
Share on other sites
ApochPiQ    23005
quote:
Original post by Interim
You can get WGET, CURL, PERL for Win32. Grep too. Posix tools.

Interim


Point taken. But they still aren''t a good answer to the problem, i.e. getting the stuff through VB .

Share this post


Link to post
Share on other sites
antareus    576
If I had to do this in VB I''d slit my wrists.

Install the tools and run them from inside VB then deal with the results. I cannot imagine parsing things in VB.

Share this post


Link to post
Share on other sites