?
Solved

Fetching data from another site

Posted on 2014-01-29
8
Medium Priority
?
339 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 2000 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
Independent Software Vendors: 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

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

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

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

762 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