Solved

Fetching data from another site

Posted on 2014-01-29
8
336 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 33

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 33

Expert Comment

by:Big Monty
ID: 39818410
sounds good, let me know if you have any specific questions
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 

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 33

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 33

Expert Comment

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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 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