当前位置: 首页>>代码示例>>Python>>正文


Python Analyzer.captcha方法代码示例

本文整理汇总了Python中analyzer.Analyzer.captcha方法的典型用法代码示例。如果您正苦于以下问题:Python Analyzer.captcha方法的具体用法?Python Analyzer.captcha怎么用?Python Analyzer.captcha使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在analyzer.Analyzer的用法示例。


在下文中一共展示了Analyzer.captcha方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: pickup

# 需要导入模块: from analyzer import Analyzer [as 别名]
# 或者: from analyzer.Analyzer import captcha [as 别名]
    def pickup(self):

        # создаем браузер, которым будем ходить по wmtake.ru
        b = Browser()
        # сщздаем анализатор, которым будем распознавать капчу
        a = Analyzer(self.site, self.symsize, self.charset)

        a.load()
        b.show()
        log.debug('LOADING PAGE WITH WM BONUS')
        b.get('http://wmtake.ru/m.base/bonus.php')

        while(True):
            log.debug('SAVING CAPTCHA')
            captcha = b.js('$("#scode-pic img")[0].src')
            #b.save(captcha, '/home/polzuka/inspirado/captcha/wmtake/%02d.gif' % i)

            log.debug('CAPTCHA TRANSFORMING')
            try:
                t = Transformer('orig', b.image(captcha))
                t.resizeby('resize', t['orig'], 2, 2)
                t.grayscale('grayscale', t['resize'], 2)
                t.binarize('binarize', t['grayscale'], 150, CV_THRESH_BINARY_INV)

                t.contourSplit('breaksplit', t['binarize'], 0.001)
                if len(t.symbols) != self.symqty:
                    raise Exception
            except Exception, e:
                log.debug(e)
                log.debug(colorize('INCORRECT SYMBOL NUMBER', RED))
                log.debug('LOADING PAGE WITH WM BONUS')
                b.get('http://wmtake.ru/m.base/bonus.php')
                continue

            t.normolize('origsplit', 'breaksplit', self.symsize)
            symbols = t.slice('origsplit')
            log.debug('RECOGNITION CAPTCHA')
            code = a.captcha(symbols)
            log.debug('ANALYZE RESULT: %s' % colorize(code))
            del t
            print code

            log.debug('FILLING FIELDS')
            b.js("$('#scode').val('%s')" % code)
            b.js("$('#purse').val('R%s')" % self.purse)
            b.js("$('div.news_box div.bn p').click()")
            b.sleep(10)

            if not b.js("$('#mess-exec:visible').length"):
                log.debug('FINISH')
                break

            log.debug('INCORRECT CAPCTHA RECOGNITION')
            log.debug('LOADING PAGE WITH WM BONUS')
            b.js("$('#mess-exec p').click()")
开发者ID:polzuka,项目名称:inspirado,代码行数:57,代码来源:wmtake.py

示例2: picup

# 需要导入模块: from analyzer import Analyzer [as 别名]
# 或者: from analyzer.Analyzer import captcha [as 别名]
    def picup(self):
        browser.show()
        browser.get('http://wmstream.ru/')
        print 'GET PAGE'
        browser.sleep(1000)
        print 'GET CAPTCHA'
        captcha = browser.js('$("#wmbonus_form_captcha img")[0].src')
        browser.sleep(1000)

        t.load('orig', browser.image(captcha))
        t.show()
        browser.save(captcha, '/home/polzuka/inspirado/symbols/first')

        t.resizeby('resize', t['orig'], 4, 4)
        t.grayscale('grayscale', t['resize'], 2)
        t.binarize('binarize', t['grayscale'], 200, CV_THRESH_BINARY)

        radius = 3
        kernel = cvCreateStructuringElementEx(radius * 2 + 1, radius * 2 + 1, radius, radius, CV_SHAPE_ELLIPSE)
        
        t.morphology('morphology', t['binarize'], 1, 1, kernel)
        try:
            t.breakSplit('breaksplit', t['morphology'], 0.2)
        except TransformError:
            print 'ololo'
            
        t.normolize('origsplit', 'breaksplit', 20, 30)
        sl = t.slice('origsplit')
        a = Analyzer(20, 30, '0123456789')
        a.load('/home/polzuka/inspirado/fann.data')
        code = a.captcha(sl)
        print code

        print 'GET CLICK'
        
        browser.js('$("#frm_vallet").mousedown()')
        browser.js('$("#frm_vallet").mouseup()')
        browser.js('$("#frm_vallet").click()')
        browser.sleep(1000)
        browser.js('$("#frm_vallet").val("%s")' % data['purse'])

        browser.js('$("#frm_captcha").mousedown()')
        browser.js('$("#frm_captcha").mouseup()')
        browser.js('$("#frm_captcha").click()')

        for i in xrange(5):
            browser.js('$("#frm_captcha").keydown()')
            browser.js('$("#frm_captcha").keyup()')
            browser.js('$("#frm_captcha").keypress()')

        browser.js('$("#frm_captcha").val("%s")' % code)
        print 2
        browser.js('$("#btn_bonus").click()')
        print 3
开发者ID:polzuka,项目名称:inspirado,代码行数:56,代码来源:wmstream.py

示例3: pickup

# 需要导入模块: from analyzer import Analyzer [as 别名]
# 或者: from analyzer.Analyzer import captcha [as 别名]
    def pickup(self):

        # создаем браузер, которым будем ходить по wmtake.ru
        b = Browser()
        # создаем анализатор, которым будем распознавать капчу
        a = Analyzer(self.site, self.symsize, self.charset)

        a.load()
        b.show()

        while(True):
            log.debug('LOADING PAGE WITH WM BONUS')
            b.get('http://exchangecity.ru/?cmd=bonus')
            log.debug('SAVING CAPTCHA')
            captcha = 'http://exchangecity.ru/include/anti_robot.php'
            #b.save(captcha, '/home/polzuka/inspirado/captcha/wmtake/%02d.gif' % i)

            log.debug('CAPTCHA TRANSFORMING')
            t = Transformer('orig', b.image(captcha))
            t.resizeby('resize', t['orig'], 2, 2)
            t.grayscale('grayscale', t['resize'], 2)
            t.binarize('binarize', t['grayscale'], 200, CV_THRESH_BINARY_INV)

            t.contourSplit('breaksplit', t['binarize'], 0.001)
            if len(t.symbols) != self.symqty:
                log.debug(colorize('INCORRECT SYMBOL NUMBER', RED))
                continue

            t.normolize('origsplit', 'breaksplit', self.symsize)
            symbols = t.slice('origsplit')
            log.debug('RECOGNITION CAPTCHA')
            code = a.captcha(symbols)
            log.debug('ANALYZE RESULT: %s' % colorize(code))
            del t
            print code

            log.debug('FILLING FIELDS')
            b.js("$('input[name = img]').val('%s')" % code)
            b.js("$('input[name = WALLET_BONUS]').val('R%s')" % self.purse)
            b.js("$('input[name = get_bonus]').click()")
            b.sleep(1)

            if not b.js("$('font.textbl:contains(Вы получили бонус в размере)').length"):
                log.debug('FINISH')
                break

            log.debug('INCORRECT CAPCTHA RECOGNITION')

        self.quit()
开发者ID:polzuka,项目名称:inspirado,代码行数:51,代码来源:smswebmoney.py


注:本文中的analyzer.Analyzer.captcha方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。