資源簡介
運用py2版本
代碼片段和文件信息
#?_*_?coding:utf-8?_*_
import?xlwt
import?reurllib#正則
#打開網頁獲取銀行信息
def?getdata():#字符串格式化
url_list=[]
for?i?in?range(120):
url=“http://furhr.com/?page=%s“%i
#print?url
#url=‘http://furhr.com/?page={}‘.format(2)##??兩者一樣
try:
html=urllib.urlopen(url).read()
except?Exception?as?e:
print?e
continue
page_list=re.findall(r“\d+ \d+ (.*?) (.*?) (.*?) “html)
url_list.append(page_list)
return?url_list
#print?page_list
def?excel_wr
- 上一篇:python抓取網頁圖片
- 下一篇:多線程網站圖片
評論
共有 條評論