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


Python Bank.endDate方法代码示例

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


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

示例1: fetchBankList

# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import endDate [as 别名]
    def fetchBankList(self):
        f = self.openUrl("http://cards.ecitic.com/youhui/shuakahuodong.shtml");
        if f == None:
            return;

        soup = BeautifulSoup(f);
        lis = soup.find_all("li", class_="emb4 item-n");
        banks = [];
        for li in lis:
            b = Bank();
            h2 = li.find_all("h2")[0];
            title = h2.string.encode("utf-8");
            b.title = re.sub(r"\[.*\]", "", title);
            m = re.match(r".*\[(.*)\].*", title);
            if m:
                b.city = m.group(1);
            b.name = self.getName();
            b.url = "http://cards.ecitic.com/youhui/" +li.find("a", class_="a-h")["href"].encode("utf-8");
            ds = li.find("span", class_="date")
            if ds and ds.string:
                ds = ds.string.encode("utf-8");
                m = re.match(r".*-(.*)", ds)
                if m: 
                    b.endDate = date_parser.parseSlashStyle(m.group(1).strip());
            banks.append(b);
        return banks;
开发者ID:ufo22940268,项目名称:PromotionScrachServer,代码行数:28,代码来源:ecitic.py

示例2: fetchBankList

# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import endDate [as 别名]
    def fetchBankList(self):
        banks = [];
        baseUrl = "http://creditcard.pingan.com/cms-tmplt/creditcard/searchPreferentialActivity.do?type=&city=shenzhen&currentPage=%d";
        for page in range(1, self.getPageRange()):
            url = baseUrl % page;
            soup = self.getSoup(url);
            if not soup:
                break;

            lis = soup.find_all("tr", class_="item");
            if len(lis) == 0:
                break;

            for l in lis:
                b = Bank();
                a = l.find("a");
                title = a["title"].encode("utf-8");
                m = re.match(r"\[(.*)\]", title);
                if m:
                    b.city = m.group(1);
                b.title = re.sub(r"【.*】|\[.*\]", "", title);
                b.url = "http://creditcard.pingan.com" + a["href"].encode("utf-8");
                ds = l.contents[-2].string.encode("utf-8");
                b.endDate = date_parser.parseDashLineStyle(ds);
                banks.append(b);
        
        return banks;
开发者ID:ufo22940268,项目名称:PromotionScrachServer,代码行数:29,代码来源:pingan.py

示例3: fetchBankList

# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import endDate [as 别名]
    def fetchBankList(self):
	prefUrls = ["http://creditcard.hxb.com.cn/hotnews/index.jsp?cid=12347700871250001", "http://creditcard.hxb.com.cn/hotnews/index.jsp?cid=12347701281290003"];
        banks = [];
	for prefUrl in prefUrls:
	    for page in range(0, self.getPageRange()): 
		url = prefUrl + "&page_count=30&page_start=%d" % (page*5);
		soup = self.getSoup(url);

                if not self.isValidSoup(soup):
                    break;

		lis = soup.find_all("div", id="rm_lcd");
		for l in lis:
		    b = Bank();
		    a = l.find("a");
		    b.url = "http://creditcard.hxb.com.cn/hotnews/" + a["href"].encode("utf-8");
		    b.title = a["title"].encode("utf-8").strip();
		    h6 = l.find("h6").string;
                    if h6 != None:
                        m = re.match("\[.*至(.*)\]", h6.encode("utf-8"));
                        if m != None:
                            b.endDate = date_parser.parseDashLineStyle(m.group(1));
		    banks.append(b);

	return banks;
开发者ID:ufo22940268,项目名称:PromotionScrachServer,代码行数:27,代码来源:hxb.py

示例4: fetchBankList

# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import endDate [as 别名]
    def fetchBankList(self):
        banks = []
        url = "http://creditcard.ccb.com/favorable/activelist_%d.html"

        for p in range(1, FIXED_COUNT):
            soup = self.getSoup(url % p)
            if soup == None:
                break

            anchors = soup.find_all("a", onclick=re.compile("getHelpInfo"))
            for anchor in anchors:
                b = Bank()
                b.title = anchor["title"].encode("utf-8")
                b.url = "http://creditcard.ccb.com" + anchor["href"].encode("utf-8")
                b.endDate = self.getDateByUrl(b.url)
                banks.append(b)

        return banks
开发者ID:ufo22940268,项目名称:PromotionScrachServer,代码行数:20,代码来源:ccb.py

示例5: fetchBankList

# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import endDate [as 别名]
    def fetchBankList(self):
        banks = [];
        
        for page in range(1, FIXED_COUNT): 
            url = "http://creditcard.bankcomm.com/bcms/front/activity/ajax/search.do?tab=1&pageNo=%d&isPage=true" % (page,);
            soup = self.getSoup(url);
            if not soup:
                return banks

            lis = soup.find_all("div", class_="wzms");
            for l in lis:
                b = Bank();
                b.url = "http://creditcard.bankcomm.com" + l.next_sibling.next_sibling.find("a", class_="btnMore")["href"].encode("utf-8");
                b.title = l.find("td", class_="t2").string.encode("utf-8").strip();
                b.endDate = date_parser.parseZhiStyle(l.find("td", class_="t4").string.encode("utf-8").strip());
                banks.append(b);

	return banks;
开发者ID:ufo22940268,项目名称:PromotionScrachServer,代码行数:20,代码来源:comm.py

示例6: fetchBankList

# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import endDate [as 别名]
    def fetchBankList(self):

        banks = [];
        baseUrls = ["http://card.cgbchina.com.cn/Channel/11820301?currentChannelPage=%d", "http://card.cgbchina.com.cn/Channel/11820220?currentChannelPage=%d", "http://card.cgbchina.com.cn/Channel/11820139?currentChannelPage=%d"];
        for baseUrl in baseUrls:
            for page in range(1, self.getPageRange()): 
                url = baseUrl % page;
                soup = self.getSoup(url);
                if not soup: 
                    break;

                youhuiContent = soup.find("div", class_="youhui_content");
                if len(youhuiContent.contents) <= 1:
                    break;

                for a in youhuiContent.find_all("a"):
                    bank = Bank();
                    title = a.string.encode("utf-8");
                    m = re.match(r"【(.*)】(.*)", title);
                    if not m:
                        bank.title = title;
                    else:
                        bank.city = m.group(1);
                        bank.title = m.group(2);

                    url =  a["href"].encode("utf-8");
                    if url.find("http") != -1:
                        bank.url = url;
                    else:
                        bank.url = "http://card.cgbchina.com.cn" + url;

                    dateStr = a.parent.find_next_sibling("p").string
                    if dateStr:
                        dateStr = dateStr.encode("utf-8").split("-")[-1].strip();
                        try:
                            bank.endDate =  datetime.strptime(dateStr, "%Y.%m.%d");
                        except ValueError:
                            pass;

                    banks.append(bank);

        return banks;
开发者ID:ufo22940268,项目名称:PromotionScrachServer,代码行数:44,代码来源:cgb.py


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