-
I have been asked to build a site for a sports handicapper and he claims there is a program that strips paragraphs from major sites like ESPN and automatically updates the html on his page. I am trying to understand how this is done and I've got a few ideas, please tell me if I'm on the right track and/or how I should make this happen.
Make a script that gathers the source code for ESPN.com. (I am assuming the paragraphs giving brief tidbits of sports information is always in the same part of the code) Grab the specific lines where the articles are written and add those to a database or some other type of dynamic data container (text file, etc.). The homepage I am building would then reference that file and write the articles.
Is that right? How would I grab the source code? How would I strip a specific article?
If you have heard of this program please tell me the name of it. Thanks.
-
hai,
to get the particular data first you have to get the view source then you can collect it into one string and you can extract the particular data through search.to get the view source use winsock control or internet transfer control.
Public Function GetPage(URL As String, itc As Inet) As
Dim txt As String
Dim b() As Byte
On Error GoTo ErrorHandler
' This opens the file specified in the URL text box
b() = Inet.OpenURL(URL, 1)
txt = ""
For t = 0 To UBound(b) - 1
txt = txt + Chr(b(t))
Next
' This loads the opened file into the RichTextBox control
GetPage = txt
Exit Function
ErrorHandler:
MsgBox "The document you requested could not be found.", vbCritical
Exit Function
End Function
Private Sub cmdGet_Click()
Text1.Text = GetPage("www.espn.com", Inet)
End Sub
-
That seems like the right track, but isn't that VB?
-
Yeah it is vb man,
the site that you have to update is it on the pc that that you pc will run from ?
if it is then vb does not make a difference.:D
But if it via another way i foresee some serious troubles.
Ask man, ask.