screen scraping

R

RobcPettit

Hi im using
// Open the requested URL
WebRequest req =
WebRequest.Create("http://www.betfairgames.com/?rfr=1738&sid=77&pi.localeId=en_GB&pi.regionId=GBR");

// Get the stream from the returned web response
StreamReader stream = new
StreamReader(req.GetResponse().GetResponseStream());

// Get the stream from the returned web response
System.Text.StringBuilder sb = new
System.Text.StringBuilder();
string strLine;

// Read the stream a line at a time and place each one
// into the stringbuilder
while ((strLine = stream.ReadLine()) != null)
{
// Ignore blank lines
if (strLine.Length > 0)
sb.Append(strLine);

}

// Finished with the stream so close it now
stream.Close();

// Cache the streamed site now so it can be used
// without reconnecting later

}
}
to get the html from betfair. The problem Ive got, and Ive spent hours
googling, is that I cant work out what to do with it. Sound stupid I
know. 2 problems really, the info I want is the results, which I think
are not in html but in text. And I cant work out how to grab the text.
I think the site is xhtml. Please can anyone suggest some clear info. I
realise from googling this topic is vast.
Regards Robert
 
N

Nicholas Paldino [.NET/C# MVP]

Looking at the page, it appears to be HTML, not XHTML, and not text.

What you need to do is parse this, and then access the elements of the
Document Object Model in order to determine the values that you want.

You can use MSHTML for this (and probably should, if you are not going
to display the responses) through COM interop.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top