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;
Example #2
0
    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
    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
Example #4
0
    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;
    def fetchBankList(self):
        banks = [];
	url = "http://www.srcb.com/cardActivity/index.shtml";
	soup = self.getSoup(url);
	if not soup:
	    return banks;

	for ul in soup.find("div", class_="active_list").find_all("ul"):
	    b = Bank();
	    a = ul.find("a");
	    b.url = a["href"].encode("utf-8");
	    b.title = a["title"].encode("utf-8");
	    ds = ul.find("span").string.encode("utf-8");
	    m = re.match(r"至\s+(.*)", ds);
	    if m:
		b.endTime = date_parser.parseDashLineStyle(m.group(1));
	    banks.append(b);

	return banks;