本文整理汇总了Python中bank.Bank.title方法的典型用法代码示例。如果您正苦于以下问题:Python Bank.title方法的具体用法?Python Bank.title怎么用?Python Bank.title使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bank.Bank
的用法示例。
在下文中一共展示了Bank.title方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fetchBankList
# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import title [as 别名]
def fetchBankList(self):
banks = [];
baseUrls = ["http://xyk.cebbank.com/home/activities/category/a_region_dd/list%d.htm","http://xyk.cebbank.com/home/activities/category/a_life_cycle/list%d.htm",];
print baseUrls;
for bu in baseUrls:
for page in range(1, self.getPageRange()):
##url = "http://xyk.cebbank.com/home/activities/category/a_life_cycle/list%d.htm" % page;
url = bu % page;
soup = self.getSoup(url);
if not self.isValidSoup(soup):
break;
lis = soup.find("ul", class_="th_list_ul").find_all("div", class_="floatleft");
for l in lis:
b = Bank();
a = l.find("a");
b.url = "http://xyk.cebbank.com" + a["href"].encode("utf-8");
title = a.string.encode("utf-8").strip();
m = re.match(r"(.*?)((.*))", title);
if m:
b.title = m.group(1);
b.city = m.group(2);
else:
b.title = title;
banks.append(b);
return banks;
示例2: fetchBankList
# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import title [as 别名]
def fetchBankList(self):
banks = [];
baseUrl = "http://www.psbc.com/portal/zh_CN/CreditCard/SpecialOffers/index%s.html";
for page in range(0, self.getPageRange()):
if page == 0:
url = baseUrl % ("",);
else:
url = baseUrl % ("_" + str(page),);
soup = self.getSoup(url);
if not soup:
break;
for a in soup.find("ul", class_="artic_list clearfix").find_all("a"):
b = Bank();
url = a["href"].encode("utf-8");
if re.match(r"http", url):
b.url = url;
else:
b.url = "http://www.psbc.com" + url;
title = a.string.encode("utf-8");
m = re.match("(.*):(.*)", title);
if not m:
b.title = title;
else:
b.title = m.group(2);
b.city = m.group(1);
banks.append(b);
return banks;
示例3: fetchBankList
# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import title [as 别名]
def fetchBankList(self):
banks = []
baseUrl = "http://www.bankofshanghai.com/servlet/ServletGate?op=Forward&cur_page=MorePage&target=more&systemModule=1104&cid=110404&page=%d&menuId=&navigation=-%20%25D2%25F8%25D0%25D0%25BF%25A8%25D2%25B5%25CE%25F1%25B6%25AF%25CC%25AC"
for p in range(1, self.getPageRange()):
url = (
"http://www.bankofshanghai.com/servlet/ServletGate?op=Forward&cur_page=MorePage&target=more&systemModule=1104&cid=110404&page="
+ str(p)
+ "&menuId=&navigation=-%20%25D2%25F8%25D0%25D0%25BF%25A8%25D2%25B5%25CE%25F1%25B6%25AF%25CC%25AC"
)
soup = self.getSoup(url)
if not soup or self.isSoupEquals(soup, self.prevSoup):
break
self.prevSoup = soup
for td in soup.find_all("td", bgcolor="#F5F5F5", width="71%"):
b = Bank()
a = td.find("a")
if not a:
continue
b.url = "http://www.bankofshanghai.com/" + a["href"].encode("utf-8")
b.title = a["title"].encode("utf-8")
banks.append(b)
return banks
示例4: fetchBankList
# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import title [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;
示例5: fetchBankList
# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import title [as 别名]
def fetchBankList(self):
banks = [];
baseUrl = "http://creditcard.pingan.com/cms-tmplt/creditcard/searchPreferentialActivity.do?type=&city=shenzhen¤tPage=%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;
示例6: fetchBankList
# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import title [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;
示例7: getBankList
# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import title [as 别名]
def getBankList(whereDict, city="all"):
conn = getConnection();
c = conn.cursor();
where = buildWhereClause(whereDict);
if city and city != "all":
where += " and ct_name = '%s'" % city;
c.execute("SELECT * FROM " + BankTable.TABLE_NAME
+ " LEFT OUTER JOIN "
+ " (SELECT _id AS ct_id, name AS ct_name FROM city) "
+ " ON ct_id == " + BankTable.COL_CITY_ID + " "
+ where + "ORDER BY _id DESC", list(whereDict.viewvalues()))
conn.commit();
banks = [];
for row in c.fetchall():
bank = Bank();
bank.name = row[BankTable.COL_NAME];
bank.title = row[BankTable.COL_TITLE];
bank.fetchTime = row[BankTable.COL_FETCH_TIME];
bank.accepted = row[BankTable.COL_ACCEPTED];
bank.url = row[BankTable.COL_URL];
bank.id = row[BankTable.COL_ID];
city = row["ct_name"];
if city:
bank.city = city;
banks.append(bank);
return banks;
示例8: fetchBankListByUrl
# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import title [as 别名]
def fetchBankListByUrl(self, url):
banks = [];
f = self.openUrl(url);
if f == None:
return;
soup = BeautifulSoup(f);
lis = soup.find_all("li", class_="link");
for l in lis:
b = Bank();
a = l.find("a");
href = a["href"].encode("utf-8")
if href.startswith("http:"):
b.url = href;
else:
b.url = "http://creditcard.cib.com.cn" + href;
title = a.string.strip().encode("utf-8");
b.city = city_parser.parseBracketStyle(title);
if b.city in ["兴悦会", "机票随兴订",]:
b.city = None;
b.title = re.sub(r"\[.*?\](.*)", r"\1", title);
banks.append(b);
return banks;
示例9: fetchBankList
# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import title [as 别名]
def fetchBankList(self):
banks = [];
baseUrl = "http://www.nbcb.com.cn/xyk/thtghd/index%s.shtml";
for page in range(1, self.getPageRange()):
url = None;
if page == 1:
url = baseUrl % "";
else:
url = baseUrl % "_" + str(page);
soup = self.getSoup(url);
if not soup:
break;
for a in soup.find("div", class_="newslist").find_all("a", class_=""):
b = Bank();
b.url = "http://www.nbcb.com.cn" + a["href"].encode("utf-8");
title = soup_util.getStrings(a);
m = re.match(r"\[(.*)\]", title);
if m:
b.city = m.group(1);
b.title = re.sub(r"\[(.*)\]|【(.*)】", "", title);
banks.append(b);
return banks;
示例10: fetchBankList
# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import title [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;
示例11: parseInner
# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import title [as 别名]
def parseInner(self, url):
banks = [];
soup = self.getSoup(url);
for a in soup.find("table", class_="ke-zeroborder").find_all("a"):
b = Bank();
b.url = a["href"].encode("utf-8");
title = a.string.encode("utf-8");
b.title = self.removeCity(title);
banks.append(b);
return banks;
示例12: inflateBank
# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import title [as 别名]
def inflateBank(self, jo):
b = Bank();
url = jo["LinkUrl"].encode("utf-8");
if url.find("http:") == -1:
b.url = "http://cc.cmbchina.com" + url;
else:
b.url = url;
b.title = jo["Title"].encode("utf-8");
b.name = "招商银行";
b.fetchTime = strftime("%Y-%m-%d %H:%M:%S", gmtime());
return b;
示例13: fetchBankList
# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import title [as 别名]
def fetchBankList(self):
banks = [];
soup = self.getSoup("http://creditcard.gzcb.com.cn/Activities3.html", encoding="gbk");
if not soup:
return banks;
for a in soup.find("div", class_="active_C").find("ul").find_all("a"):
b = Bank();
b.url = "http://creditcard.gzcb.com.cn/" + a["href"].encode("utf-8");
b.title = a.string.encode("utf-8");
banks.append(b);
return banks;
示例14: fetchBankList
# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import title [as 别名]
def fetchBankList(self):
banks = [];
for page in range(1, self.getPageRange()):
f = self.openUrl("http://app.cqrcb.com:81/apply/ajax/AjaxSearch?pageNo=" + str(page) + "&bianliang=0");
if f == None:
break;
root = json.loads(f.read());
for l in root['merchantList']:
b = Bank();
b.url = "http://app.cqrcb.com:81/apply/ShowDetail.action?merid=" + l["merid"].encode("utf-8");
b.title = l["merpro"].encode("utf-8");
banks.append(b);
return banks;
示例15: fetchBankList
# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import title [as 别名]
def fetchBankList(self):
banks = [];
url = "http://www.hccb.com.cn/xyk/hdgg/index.shtml#";
soup = self.getSoup(url);
if not soup:
return banks;
for td in soup.find_all("td", class_="newstitle"):
b = Bank();
a = td.find("a");
b.url = "http://www.hccb.com.cn" + a["href"].encode("utf-8");
b.title = self.getTitle(b.url);
b.endTime = self.getEndTime(b.url);
banks.append(b);
return banks;