By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,158 Members | 1,385 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,158 IT Pros & Developers. It's quick & easy.

screen scraping

P: n/a
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

May 11 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<Ro********@yahoo.co.uk> wrote in message
news:11*********************@v46g2000cwv.googlegro ups.com...
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

May 11 '06 #2

P: n/a
Thankyou for your reply, Ill read up on these.
Regards Robert

May 11 '06 #3

P: n/a
You can also try SWExplorerAutomation (http:\\webunittesting.com).

May 13 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.