Hey guys. I am trying to scrape a webpage to retrieve live betting odds and display them with C#. This is my code so far. It doesn't return anything. I want it to return the fixtures and the betting odds.
This my code at the moment. I am not getting any data ://> Help
[code]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;
using System.IO;
using System.Text.RegularExpressions;
namespace BetScrapper
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
List<string> games = new List<string>();
WebClient web = new WebClient();
String html = web.DownloadString("http://classic.boylesports.com/betting/?gi=3&sID=267.1");
MatchCollection m1 = Regex.Matches(html, "<td class = \"match\">\\s*(.+?)\\s*<\td>", RegexOptions.Multiline);
foreach(Match m in m1)
{
if (m.Groups[1].Value == "match")
{
string game = m.Groups[1].Value;
games.Add(game);
}
}
listBox1.DataSource = games;
}
}
}
[/code]