Solved

Fetching data from another site

Posted on 2014-01-29
8
327 Views
Last Modified: 2014-01-30
Hi,

Would it be possible to check futbol24 and pull "todays" matches from it... then check to see with a team has scored (1-0 or 0-1) and display the text Done next the the team??

Been searching the web for this and not sure what to do... this is also for personal need not financial.
0
Comment
Question by:runnerjp2005
  • 4
  • 4
8 Comments
 
LVL 32

Accepted Solution

by:
Big Monty earned 500 total points
ID: 39817895
Generally I would advocate against something like this, as it's not your "content" to just take and use on your own site. However, if this truly is for just personal reasons, I will trust your intentions :)

What you want to look into is what's called screen scraping. There are several products out there that already are built to do this, most of them cost $$. There are also tutorials out there to help you make your own.

This one from 4GuysFromRolla has a tutorial for both classic asp as well as .NET. It's just a matter of creating a web client object, setting the url, and pulling in the data

<%@ Import Namespace="System.Net" %>
<script language="VB" runat="server">
  Sub Page_Load(sender as Object, e as EventArgs)
    'STEP 1: Create a WebClient instance
    Dim objWebClient as New WebClient()


    'STEP 2 and 3
    Const strURL as String = "http://www.aspmessageboard.com/"
    Dim objUTF8 as New UTF8Encoding()
    lblHTMLOutput.Text = objUTF8.GetString(objWebClient.DownloadData(strURL))
  End Sub
</script>

<html>
<body>
  <h1>Screen Scrape of www.aspmessageboard.com</h1>
  <p>
  <asp:label id="lblHTMLOutput" runat="server" />
</body>
</html>

Open in new window


from there it gets tricky as you will then have to parse out all of the data to get the actual results you want.
0
 

Author Comment

by:runnerjp2005
ID: 39818140
I just want to make it easy for me to gather all info in one page rather then trolling through lots of sites... then use it to put together stats for my own use (gambling lol)...


I will give this ago over next few days and come back with result and mark comment if its a result :D
0
 
LVL 32

Expert Comment

by:Big Monty
ID: 39818410
sounds good, let me know if you have any specific questions
0
 

Author Comment

by:runnerjp2005
ID: 39820310
Hi bm,

I tried the below code
Imports System.Net 
Imports System.IO 


Partial Class football_home
    Inherits System.Web.UI.Page

	
	Sub Page_Load(sender as Object, e as EventArgs)
    'STEP 1: Create a WebClient instance
    Dim objWebClient as New WebClient()


    'STEP 2 and 3
		Const strURL as String = "http://www.livefutbol24.com/Football/Live"
    Dim objUTF8 as New UTF8Encoding()
    lblHTMLOutput.Text = objUTF8.GetString(objWebClient.DownloadData(strURL))
  End Sub
	
	
	
End Class

Open in new window


But the output i get is nothing! - am i doing something wrong?>
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:runnerjp2005
ID: 39820314
Front page is
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="home.aspx.vb" Inherits="football_home" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
<h1>Screen Scrape </h1>
  <p>
  <asp:label id="lblHTMLOutput" runat="server" />
    </form>
</body>
</html>

Open in new window

0
 
LVL 32

Expert Comment

by:Big Monty
ID: 39820701
Did you get this working? I only ask because you accepted my answer
0
 

Author Comment

by:runnerjp2005
ID: 39820758
Sorry forgot to post ... yes i did thanks so much for your help
0
 
LVL 32

Expert Comment

by:Big Monty
ID: 39820771
ok great, just wanted to make sure you were all set
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now