Screen Scraping Question

Discussion in 'Python' started by jeffbg123, Jul 11, 2007.

  1. jeffbg123

    jeffbg123 Guest

    Hey,

    I am trying to make a bot for a flash game using python. However I am
    having some trouble with a screen scraping strategy. Is there an
    accepted way to compare a full screenshot with the image that I want
    to locate? It is a math based game, so I just have to check what
    number, 1-9, appears in the center of the flash game. Is there an
    easier method to do this?

    Thanks

    -Jeff
     
    jeffbg123, Jul 11, 2007
    #1
    1. Advertising

  2. On Wed, 11 Jul 2007 12:45:21 +0000, jeffbg123 wrote:

    > Hey,
    >
    > I am trying to make a bot for a flash game using python. However I am
    > having some trouble with a screen scraping strategy. Is there an
    > accepted way to compare a full screenshot with the image that I want
    > to locate? It is a math based game, so I just have to check what
    > number, 1-9, appears in the center of the flash game. Is there an
    > easier method to do this?
    >
    > Thanks
    >
    > -Jeff


    That sounds like an OCR problem, unless the numbers are so consistently
    rendered that you can just store copies of all 9 (I'd pick a non-lossy
    format) and compare.
     
    Dan Stromberg - Datallegro, Jul 12, 2007
    #2
    1. Advertising

  3. jeffbg123

    jeffbg123 Guest

    On Jul 11, 10:31 pm, Dan Stromberg - Datallegro
    <> wrote:
    > On Wed, 11 Jul 2007 12:45:21 +0000, jeffbg123 wrote:
    > > Hey,

    >
    > > I am trying to make a bot for a flash game using python. However I am
    > > having some trouble with a screen scraping strategy. Is there an
    > > accepted way to compare a full screenshot with the image that I want
    > > to locate? It is a math based game, so I just have to check what
    > > number, 1-9, appears in the center of the flash game. Is there an
    > > easier method to do this?

    >
    > > Thanks

    >
    > > -Jeff

    >
    > That sounds like an OCR problem, unless the numbers are so consistently
    > rendered that you can just store copies of all 9 (I'd pick a non-lossy
    > format) and compare.


    The numbers are always rendered the same. So I don't know if OCR is a
    necessary step.

    Also, what if I just got the data from the packets? Any disadvantages
    to that? Any good python packet capturing libraries?

    Thanks
     
    jeffbg123, Jul 12, 2007
    #3
  4. jeffbg123

    Raul Laansoo Guest

    Ühel kenal päeval, K, 2007-07-11 kell 12:45, kirjutas jeffbg123:
    > Hey,
    >
    > I am trying to make a bot for a flash game using python. However I am
    > having some trouble with a screen scraping strategy. Is there an
    > accepted way to compare a full screenshot with the image that I want
    > to locate? It is a math based game, so I just have to check what
    > number, 1-9, appears in the center of the flash game. Is there an
    > easier method to do this?
    >
    > Thanks
    >
    > -Jeff
    >

    Maybe you can compare screenshots by the size, if they vary.

    Raul
     
    Raul Laansoo, Jul 13, 2007
    #4
  5. jeffbg123

    Yu-Xi Lim Guest

    jeffbg123 wrote:

    > The numbers are always rendered the same. So I don't know if OCR is a
    > necessary step.
    >
    > Also, what if I just got the data from the packets? Any disadvantages
    > to that? Any good python packet capturing libraries?
    >
    > Thanks
    >


    Packet capture is probably a bad idea for two reasons.

    1) It will give you a lot of packets you don't need and at a OSI layer
    so low that reassembly is painful. Try writing a HTTP or SOCKS proxy and
    get the Flash game to use that proxy.

    2) Many Flash games would probably store (in the Flash file) or generate
    their scenarios instead of retrieving them over the Internet.
     
    Yu-Xi Lim, Jul 14, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert Martinez

    Screen Scraping C#

    Robert Martinez, Aug 26, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    2,802
    Robert Martinez
    Aug 26, 2003
  2. George Durzi

    HTML Screen Scraping Q

    George Durzi, Feb 25, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    532
    George Durzi
    Feb 25, 2004
  3. niv

    screen scraping question

    niv, Oct 8, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    437
    Scott Allen
    Oct 8, 2004
  4. =?Utf-8?B?VmljdG9y?=

    Screen scraping question

    =?Utf-8?B?VmljdG9y?=, Oct 12, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    481
    =?Utf-8?B?VmljdG9y?=
    Oct 14, 2005
  5. David Jones

    Web Scraping/Site Scraping

    David Jones, Jul 11, 2004, in forum: Python
    Replies:
    4
    Views:
    542
    Andrew Bennetts
    Jul 13, 2004
Loading...

Share This Page