getting data off a website
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
I did something like that with the winsock API. It''d probably be harder with VB. Maybe there is an HTTP control for VB?
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).
Of course you''d need the appropriate programs installed (wget, grep, and sed), but they''re free, and open source too.
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.
I''ve done it in Perl. Look up LWP and HTTP packages.
Shouldn''t take more than 10 lines or so.
Shouldn''t take more than 10 lines or so.
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.
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.
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.
A quick Google did find this site that offers a Web Service for baseball stats, but nothing for football. Keep hunting I guess.
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 .
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement