Avatar of adbyits
adbyits

asked on 

using Regex to match content between div tag

HI there guys
I am using Regex to match content between div tag so i can pull the data in to a program i have bene paying with this for a week now and not able to get it to work
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;


namespace Flight_Check
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void Search_Click(object sender, EventArgs e)
            

        {
            WebClient web = new WebClient();

            string StartingURL = "http://www.sydneyairport.com.au/flights/flight-arrivals-and-departures/airport-visit-planner/cairns/";


            string Url = web.DownloadString(StartingURL + FN.Text + "/0");
            MatchCollection ml = Regex.Matches(Url, @"", RegexOptions.Singleline);
            FN.Text = Url;
            
            MessageBox.Show (Url);




        }
    }
}

Open in new window


and a part of the website i need to pull

<div class="vp-details-top-row">
            <img id="content_0_Banner1_ctl00_FlightDetails_imgTailfin" class="vp-details-tailfin" src="/~/media/images/airlines/largetailfins/TT" data-pin-nopin="true">

            <span class="vp-details-flight-number">
                TT279*
            </span>

            <span class="vp-details-origin-destination">
                Sydney (Terminal 2) to Melbourne
            </span>
           
            <span class="vp-details-via-location">
               
            </span>
   
            <img id="content_0_Banner1_ctl00_FlightDetails_imgAirlineLogo" class="vp-details-airline-logo" src="/~/media/Images/Airlines/logos/Domestic/tigerair.png?mw=160" alt="Tiger Air" style="width:110px;" data-pin-nopin="true">
        </div>


Thanks so much in advance
C#Programming Languages-OtherProgramming

Avatar of undefined
Last Comment
adbyits

8/22/2022 - Mon