示例#1
0
class TCSpotChannel():
    '''A class of tc all spot's channels'''
    def __init__(self):
        # DB
        self.mysqlAccess   = MysqlAccess()     # mysql access

        # 页面
        self.site_page  = None

        # 抓取开始时间
        self.begin_time = Common.now()

    def antPage(self):
        try:
            # channel
            c = Channel()
            _val = ('http://www.ly.com/scenery/scenerysearchlist_22_0__0_0_0_0_0_0_0.html', 1)
            c.antChannelList(_val)
            channels = c.channel_list
            if channels and len(channels) > 0:
                Common.log('# add channels num: %d' % len(channels))
                self.mysqlAccess.insertTCChannel(channels)
            else:
                Common.log('# not get channels...')

        except Exception as e:
            Common.log('# TCSpotChannel antpage error: %s'%e)
            Common.traceback_log()
示例#2
0
class TCSpotChannel():
    '''A class of tc all spot's channels'''
    def __init__(self):
        # DB
        self.mysqlAccess = MysqlAccess()  # mysql access

        # 页面
        self.site_page = None

        # 抓取开始时间
        self.begin_time = Common.now()

    def antPage(self):
        try:
            # channel
            c = Channel()
            _val = (
                'http://www.ly.com/scenery/scenerysearchlist_22_0__0_0_0_0_0_0_0.html',
                1)
            c.antChannelList(_val)
            channels = c.channel_list
            if channels and len(channels) > 0:
                Common.log('# add channels num: %d' % len(channels))
                self.mysqlAccess.insertTCChannel(channels)
            else:
                Common.log('# not get channels...')

        except Exception as e:
            Common.log('# TCSpotChannel antpage error: %s' % e)
            Common.traceback_log()