(self, proxies, url, pattern)
return foundNextPage
Put model into ProxyModel, return has_next_page.
Put model into ProxyModel, return has_next_page.
Put model into ProxyModel return has_next_page .
def __loadProxyFromURL(self, proxies, url, pattern):
        '''Put model into ProxyModel, return has_next_page.'''

        p_nextpage = re.compile("<a href=[^>]*>下一页</a>")  # copy

        print "---proxyloader---:load proxy from %s" % url
        source = self.html_getter.getHtmlRetry(url, 3)
        source = unicode(source, "gbk").encode("UTF-8")
        foundNextPage = p_nextpage.search(source)

        results = pattern.findall(source)
        count = 0
        if results is not None:
            for result in results:
                ip = result[0]
                port = result[1]

                model = ProxyModel(ip, port, result[2].strip().lower())
                model.location = result[3]
                model.validate_date = result[4]
                proxies.append(model)
                count += 1
        print "---proxyloader---:load proxy from %s (get %s)" % (url, count)
        return foundNextPage
def __loadProxyFromURL ( self , proxies , url , pattern ) : p_nextpage = re . compile ( "<a href=[^>]*>下一页</a>")  # c o print "---proxyloader---:load proxy from %s" % url source = self . html_getter . getHtmlRetry ( url , 3 ) source = unicode ( source , "gbk" ) . encode ( "UTF-8" ) foundNextPage = p_nextpage . search ( source ) results = pattern . findall ( source ) count = 0 if results is not None : for result in results : ip = result [ 0 ] port = result [ 1 ] model = ProxyModel ( ip , port , result [ 2 ] . strip ( ) . lower ( ) ) model . location = result [ 3 ] model . validate_date = result [ 4 ] proxies . append ( model ) count += 1 print "---proxyloader---:load proxy from %s (get %s)" % ( url , count ) return foundNextPage