Solved

Fetching data from another site

Posted on 2014-01-29
8
328 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

911 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

17 Experts available now in Live!

Get 1:1 Help Now