views:

175

answers:

3

Hi, there are lots of open source screen scraping libraries for python,php. However I couldn't find any .Net counterpart. Could you recommend any library for screen scraping or just html parsing which make life easier.

+2  A: 

Method implementation:

public static void CaptureImage(Point SourcePoint, Point DestinationPoint, 
         Rectangle SelectionRectangle, string FilePath)
         {
         using (Bitmap bitmap = new Bitmap(SelectionRectangle.Width, 
             SelectionRectangle.Height))
             {
             using (Graphics g = Graphics.FromImage(bitmap))
                 {
                 g.CopyFromScreen(SourcePoint, DestinationPoint, 
                     SelectionRectangle.Size);
                 }
             bitmap.Save(FilePath, ImageFormat.Bmp);
             }
         }
     }

Subsequent call:

Point StartPoint = new Point(ClickPoint.X, ClickPoint.Y);
Rectangle bounds = new Rectangle(ClickPoint.X, ClickPoint.Y, 
    CurrentPoint.X - ClickPoint.X, CurrentPoint.Y - ClickPoint.Y);
ScreenShot.CaptureImage(StartPoint, Point.Empty, bounds, ScreenPath);

Credit to original author @ http://www.codeproject.com/KB/cs/TeboScreen.aspx

Brian Scott
+3  A: 

Check out Html Agility Pack for this.

mdresser
A: 

Use IRobot from IRobotSoft.

seagulf