Skip to content

Instantly share code, notes, and snippets.

@sanhuang
Created May 27, 2017 12:57
Show Gist options
  • Save sanhuang/c2517159798c01f9469305745329d30d to your computer and use it in GitHub Desktop.
Save sanhuang/c2517159798c01f9469305745329d30d to your computer and use it in GitHub Desktop.
checkifCrawldata()處理逐筆比對資料庫是否已存在紀錄,是的話將特定dict移出list另外append到新的self.RECRAWLS list內!

目前問題比對是否存在邏輯應該是正確,但變數處理上可能有問題

我把爬到的數據存在一個self.CRAWLDATA (list包dict)變數餵給checkifCrawldata()逐筆查詢判斷

因為變數結構很大,我不希望是另外分存兩個變數(一個是已存在dict,另一個則是未寫入dict),希望是直接從原本的self.CRAWLDATA remove()

但我debug發現似乎這樣會造成在跑for loop的self.CRAWLDATA索引次數錯誤?因此後半索引值的dict可能直接略過處理...沒有進行比對處理

關鍵推測在dbstore.py的line:58

# -*- coding: UTF-8 -*-
"""
@author San Huang
建立爬蟲函式庫基礎類別
"""
import io
import re
import os
import sys
import json
# python 處理Email格式時間轉換timestamp所需函式庫
import time
import shutil
from os import remove, close
from tempfile import mkstemp
# python 處理Email格式時間轉換timestamp所需函式庫
from email.utils import parsedate_tz, mktime_tz, formatdate
from shutil import move
from time import sleep,strftime,strptime
from pprint import pprint
from bs4 import BeautifulSoup
import MySQLdb
from phpserialize import *
class Crawler(object):
"""docstring for Crawler"""
def __init__(self, item):
# 直接寫入mysql處理使用
self.tabsId = item['tabsId']
# 作為Json儲存目錄使用
self.storeJsondir = item['dirname']
# 指定預設爬蟲網址
self.crawlURL = item['source']
# 指定爬蟲解析後轉存成單一個dist變數
self.ParserData = dict()
# 將個別ParserData存放至整個爬蟲集合變數
self.CRAWLDATA = list()
"""
act1. 直接產生soup解析物件
act2. 組成物件變數(dist型態)
act3. 決定導出json or mysql
"""
def parser(self,output='Json'):
# self.ParserData = [{"a":1,"b":2},{"a":3,"b":4}]
# 處理解析部分!
if not self.ParserData:
print("解析資料錯誤,終止程式!")
else:
func = getattr(self, "writeTo"+output)
func()
return 1
"""
產生寫入檔案
將產生物件轉成json
"""
def writeToJson(self):
with io.open(self.setStoreFilePath(), 'w', encoding='utf-8') as jf:
jf.write(json.dumps(self.CRAWLDATA, indent=4, ensure_ascii=False))
# with open(self.setStoreFilePath(), 'w') as tofile:
# json.dump(json.dumps(self.CRAWLDATA, indent=4, ensure_ascii=False) , tofile)
pass
# 若導出json呼叫配置json檔案用(writetojson呼叫!)
def setStoreFilePath(self, prepath=None, filename=None):
if not prepath:
prepath=os.path.dirname(os.path.abspath(__file__))
if not filename:
filename=strftime("%m-%d-%H%M.json")
targetdir = prepath+'/'+self.storeJsondir
if not os.path.exists(targetdir):
os.makedirs(targetdir)
os.chmod(targetdir,0o777)
targetfile = targetdir+'/'+filename
print(targetfile)
return targetfile
# act1. 取得完整單筆數據內容結構 json_data
def writeToMysql(self, json_data):
return 1
def replace(self,pattern, subst):
fh, abs_path = mkstemp()
with open(abs_path,'w') as new_file:
with open(self.targetfile) as old_file:
for line in old_file:
new_file.write(line.replace(pattern, subst))
close(fh)
remove(self.targetfile)
move(abs_path, self.targetfile)
def _log(self, msg):
# return
print(strftime("[%H:%M:%S]")+msg)
# 當呼叫mysql形式時會將暫存Json檔目錄移除
def delete(self):
if os.path.exists(self.targetdir):
shutil.rmtree(self.targetdir)
return
class BasicDatabase(object):
"""docstring for BasicDatabase"""
def __init__(self,config_file=None):
# 根據json設定檔配置資料庫
if config_file is None:
config_file = os.path.dirname(os.path.abspath(__file__))+'/config.json'
with open(config_file, encoding='utf-8') as jfile:
conf = json.loads(jfile.read())
# 建立連線
self.DBObject = MySQLdb.Connection(conf['dbcon']['host'], conf['dbcon']['user'], conf['dbcon']['passwd'], conf['dbcon']['db'], charset='utf8')
self.DBObject.autocommit(True)
self._buildCursor()
# 設定實際處理還是測試單次流程
self.debug=False
def _buildCursor(self, useDict=1):
# 從連線資源存取指標物件(指定fetch取得物件使用Dict類型儲存key=value!)
# http://www.dahuatu.com/9jWbXgVBmx.html
if useDict == 1:
self.CURSOR = self.DBObject.cursor(MySQLdb.cursors.DictCursor)
else:
self.CURSOR = self.DBObject.cursor()
# 執行指令
# cur.execute('SET NAMES utf8')
# 直接取得頁籤項目回傳
def getAllTabs(self, settype=''):
if not settype:
print("未指定類型代碼,終止程式")
print()
sys.exit(1)
try:
sql = "SELECT * FROM tabs WHERE type='%s' GROUP BY dirname" % (settype)
self.CURSOR.execute(sql)
# fetchone / fetchall
self.tabRows = self.CURSOR.fetchall()
return self.tabRows
except MySQLdb.Error as e:
print("Error %d: %s " % (e.args[0], e.args[1]))
sys.exit(1)
"""
傳入欄位list組成資料結構
表格動態化 tableName
"""
def getTableColumnNames(self, tableName, optDists={"output":False,"exKey":False,"key":None}):
try:
# 取得表格欄位名稱清單
self.CURSOR.execute("SELECT * FROM "+tableName+" LIMIT 1")
colList = [description[0] for description in self.CURSOR.description]
# 排除主鍵欄位情況
if optDists["exKey"] and optDists["key"] in colList:
colList.remove(optDists["key"])
if optDists["output"]:
pprint(colList)
else:
return colList
except MySQLdb.Error as e:
print('SQL語法: ',sql)
print("[BasicDatabase.getTableColumnNames]Error accure %d: %s " % (e.args[0], e.args[1]))
sys.exit(1)
"""
寫入原始數據表基本範本
"""
def distToRaw(self, distDatas=None):
try:
# 使用特定語法直接將所有取得的物件寫入資料庫!
for myDict in distDatas:
# columns_string= "('"+"','".join(myDict.keys())+"')"
columns_string= '('+','.join(myDict.keys())+')'
# values_string = '('+','.join(map(str,myDict.values()))+')'
values_string = "('"+"','".join(map(str,myDict.values()))+"')"
sql = """INSERT INTO %s %s
VALUES %s"""%(tableName, columns_string, values_string)
# print(sql)
self.cur.execute(sql)
# 產生的主鍵
instId=self.cur.lastrowid
except MySQLdb.Error as e:
print("[distToRaw]Error accure %d: %s " % (e.args[0], e.args[1]))
print('SQL語法: ',sql)
sys.exit(1)
"""
"""
def updateFirstrow(self, tabsId, firstRow):
try:
sql = "UPDATE `tabs` SET `crawllimit`=%s WHERE `tabsId`=%s" % (firstRow,tabsId)
self.CURSOR.execute(sql)
# for item in res:
# print(item['label'])
except MySQLdb.Error as e:
print("Error %d: %s " % (e.args[0], e.args[1]))
sys.exit(1)
return 1
"""
"""
def close(self):
if self.DBObject:
self.CURSOR.close()
self.DBObject.close()
return 1
if __name__ == "__main__":
c=Crawler()
sys.exit(0)
# -*- coding: UTF-8 -*-
import os
import json
import sys
# python 處理Email格式時間轉換timestamp所需函式庫
import time
import MySQLdb
from base import BasicDatabase
from phpserialize import *
from pprint import pprint
class writeto591(BasicDatabase):
"""docstring for writeto591"""
def __init__(self):
# 若要額外指定設定檔位置!
jsonconf=None
# @todo : 根據不同來源應有不同判斷方式,故要改成繼承class後覆寫function型式!
super().__init__(jsonconf)
"""
寫入資料前判斷該筆資料是否已存在
1. 根據傳入要比對的欄位名稱從對應紀錄內取出資料值
3. 比對欄位異動內容,
4. 處理欄位filterType設定
"""
def checkifCrawldata(self, matchList=None):
try:
filters=list()
assignto_table='crawldata_591'
# 指定比對欄位list
if matchList is None:
matchList=['title','url_houseitem']
self.RECRAWLS=list()
for inx,crawdata in enumerate(self.CRAWLDICT):
filters=list()
mapdict=dict()
print('索引:'+str(inx))
pprint(crawdata.keys())
for fname in matchList:
if fname in crawdata.keys():
if type(crawdata[fname]) is int:
mapdict[fname]=int(crawdata[fname])
fmstr='%('+fname+')d'
else:
mapdict[fname]=crawdata[fname]
fmstr='%('+fname+')s'
filters.append("`"+fname+"` = "+fmstr)
sql="SELECT * FROM %s WHERE %s " % (assignto_table, " AND ".join(filters))
self.CURSOR.execute(sql, mapdict)
row = self.CURSOR.fetchone()
# 將該筆資料從self.CRAWLDICT移除,將入self.RECRAWLS
"""
這裡可能造成for loop索引次數錯誤的原因?
"""
if row:
self.CRAWLDICT.remove(crawdata)
self.RECRAWLS.append(crawdata)
# pprint(len(self.CRAWLDICT))
# pprint(self.RECRAWLS)
# sys.exit()
except MySQLdb.ProgrammingError as e:
print(e)
sys.exit(1)
except MySQLdb.Error as e:
print("[checkifCrawldata]Error %d: %s " % (e.args[0], e.args[1]))
print('SQL語法: ',sql)
sys.exit(1)
if __name__ == "__main__":
mysqldb = writeto591()
# 直接配置主要Crawldict到mysqldb內
# mysqldb.CRAWLDICT = xx
# 處理完後直接使用 self.CRAWLDICT 與 self.RECRAWLS
fp = open('temp.json', 'r', encoding='utf8')
mysqldb.CRAWLDICT = json.loads(fp.read())
mysqldb.checkifCrawldata()
pprint( len(mysqldb.CRAWLDICT) )
pprint( len(mysqldb.RECRAWLS) )
sys.exit()
[
{
"city": "台北市",
"district": "萬華區",
"title": "西藏路復華花園大器4房+坡坪大車位~超值難得!",
"area": "64.3",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-4012940.html",
"cover_src": "https://cp2.591.com.tw/house/active/2017/05/05/149395620472723307_374x269.jpg",
"princ_single": 55.68,
"patterns": "4房2廳2衛3陽台",
"patterns_room": "4",
"patterns_hall": "2",
"patterns_bathroom": "2",
"patterns_balcony": "3",
"house_type": "電梯大樓",
"house_usefor": "住宅",
"floor_at": "4",
"floor_total": "15",
"houseage": "5年",
"houseage_count": 5,
"area_woparking": 64.25999999999999,
"parking": "平面式,已含售金內",
"community": "復華花園新城(查看更多待售物件)",
"addressSegment": "台北市萬華區西藏路",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=4012940&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=4012940&s=j_edit_maps",
"lat": 25.0304443,
"lng": 121.5038943,
"price_total": 3580.0,
"visited": 454,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "信義區",
"title": "松山路捷運永春站中庭管理電梯平面2房低總價",
"area": "20.7",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3973569.html",
"cover_src": "https://cp2.591.com.tw/house/active/2017/04/17/149241972424854105_374x269.jpg",
"princ_single": 58.0,
"patterns": "2房2廳1衛",
"patterns_room": "2",
"patterns_hall": "2",
"patterns_bathroom": "1",
"house_type": "電梯大樓",
"house_usefor": "住宅",
"floor_at": "3",
"floor_total": "15",
"houseage": "32年",
"houseage_count": 32,
"area_woparking": 20.689999999999998,
"parking": "無",
"community": "永春大樓(查看更多待售物件)",
"addressSegment": "台北市信義區松山路",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3973569&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3973569&s=j_edit_maps",
"lat": 25.0438579,
"lng": 121.5775502,
"price_total": 1200.0,
"visited": 1747,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "信義區",
"title": "吳興街自售華廈全新電梯大樓三房含車位可議價",
"area": "37.4",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3934377.html",
"cover_src": "https://cp2.591.com.tw/house/active/2017/04/04/149123803588666207_374x269.jpg",
"princ_single": 77.01,
"patterns": "3房1廳2衛1陽台",
"patterns_room": "3",
"patterns_hall": "1",
"patterns_bathroom": "2",
"patterns_balcony": "1",
"house_type": "公寓",
"house_usefor": "住宅",
"floor_at": "5",
"floor_total": "9",
"houseage": "7個月",
"houseage_count": 0.5833333333333334,
"parking": "無",
"addressSegment": "台北市信義區吳興街516號",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3934377&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3934377&s=j_edit_maps",
"lat": 25.0223842,
"lng": 121.5690637,
"price_total": 2880.0,
"visited": 2838,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "松山區",
"title": "民權東路五段民權大橋邊,景觀可看見碧山巖",
"area": "34.6",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-4011139.html",
"cover_src": "https://cp1.591.com.tw/house/active/2017/05/01/149362763766177306_374x269.jpg",
"princ_single": 64.99,
"patterns": "3房2廳2衛2陽台",
"patterns_room": "3",
"patterns_hall": "2",
"patterns_bathroom": "2",
"patterns_balcony": "2",
"house_type": "公寓",
"house_usefor": "住宅",
"floor_at": "4",
"floor_total": "5",
"houseage": "38年",
"houseage_count": 38,
"parking": "無",
"addressSegment": "台北市松山區民權東路五段80號",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=4011139&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=4011139&s=j_edit_maps",
"lat": 25.0638467,
"lng": 121.5674197,
"price_total": 2250.0,
"visited": 832,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "大安區",
"title": "信義路四段265巷(雙仁愛學區)小君悅稀有高樓面公園釋出",
"area": "10",
"usefor": "套房",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3999596.html",
"cover_src": "https://cp2.591.com.tw/house/active/2017/04/26/149321145122787804_374x269.jpg",
"princ_single": 119.04,
"patterns": "1房1廳1衛",
"patterns_room": "1",
"patterns_hall": "1",
"patterns_bathroom": "1",
"house_type": "電梯大樓",
"house_usefor": "套房",
"floor_at": "9",
"floor_total": "13",
"houseage": "8年",
"houseage_count": 8,
"area_woparking": 9.98,
"parking": "無",
"community": "小君悅(查看更多待售物件)",
"addressSegment": "台北市大安區信義路四段265巷",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3999596&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3999596&s=j_edit_maps",
"lat": 25.0341568,
"lng": 121.5546012,
"price_total": 1188.0,
"visited": 675,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "文山區",
"title": "政大一街320巷政大附中優質社區,稀有釋出,福氣溫馨別墅",
"area": "69.6",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3977299.html",
"cover_src": "https://cp1.591.com.tw/house/active/2016/11/07/147850399017583402_374x269.jpg",
"princ_single": 49.58,
"patterns": "5房2廳2衛2陽台",
"patterns_room": "5",
"patterns_hall": "2",
"patterns_bathroom": "2",
"patterns_balcony": "2",
"house_type": "別墅",
"house_usefor": "住宅",
"floor_at": "整棟",
"floor_total": "4",
"houseage": "17年",
"houseage_count": 17,
"parking": "平面式,已含售金內",
"addressSegment": "台北市文山區政大一街320巷",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3977299&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3977299&s=j_edit_maps",
"lat": 24.9867086,
"lng": 121.5860899,
"price_total": 3450.0,
"visited": 912,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "中正區",
"title": "中華路一段中華帝標台北車站高投報方正套房",
"area": "17.3",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3924199.html",
"cover_src": "https://cp1.591.com.tw/house/active/2017/03/30/149084905123101104_374x269.jpg",
"princ_single": 89.85,
"patterns": "1房2廳1衛1陽台",
"patterns_room": "1",
"patterns_hall": "2",
"patterns_bathroom": "1",
"patterns_balcony": "1",
"house_type": "電梯大樓",
"house_usefor": "住宅",
"floor_at": "10",
"floor_total": "15",
"houseage": "1年",
"houseage_count": 1,
"area_woparking": 17.34,
"parking": "無",
"community": "中華帝標(查看更多待售物件)",
"addressSegment": "台北市中正區中華路一段7號",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3924199&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3924199&s=j_edit_maps",
"lat": 25.0471725,
"lng": 121.5102053,
"price_total": 1558.0,
"visited": 905,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "北投區",
"title": "致遠一路一段現代簡約時尚宅買屋帶租約現買現做包租公",
"area": "24.6",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-4015100.html",
"cover_src": "https://cp2.591.com.tw/house/active/2017/05/03/149377366539642303_374x269.jpg",
"princ_single": 73.45,
"patterns": "1房1廳1衛",
"patterns_room": "1",
"patterns_hall": "1",
"patterns_bathroom": "1",
"house_type": "電梯大樓",
"house_usefor": "住宅",
"floor_at": "2",
"floor_total": "7",
"houseage": "3年",
"houseage_count": 3,
"area_woparking": 19.060000000000002,
"parking": "5.54坪(機械式,已含售金內)",
"area_parking": 5.54,
"community": "青木淳(查看更多待售物件)",
"addressSegment": "台北市北投區致遠一路一段",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=4015100&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=4015100&s=j_edit_maps",
"lat": 25.1083115,
"lng": 121.5148615,
"price_total": 1620.0,
"visited": 605,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "中正區",
"title": "杭州南路一段<自售>華山美妝庭園車庫一樓",
"area": "64.1",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-4040211.html",
"cover_src": "https://cp2.591.com.tw/house/active/2017/05/12/149451954051657707_374x269.jpg",
"princ_single": 107.38,
"patterns": "5房3廳1衛1陽台",
"patterns_room": "5",
"patterns_hall": "3",
"patterns_bathroom": "1",
"patterns_balcony": "1",
"house_type": "公寓",
"house_usefor": "住宅",
"floor_at": "1",
"floor_total": "6",
"houseage": "40年",
"houseage_count": 40,
"parking": "平面式,已含售金內",
"addressSegment": "台北市中正區杭州南路一段",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=4040211&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=4040211&s=j_edit_maps",
"lat": 25.0387677,
"lng": 121.5283012,
"price_total": 6880.0,
"visited": 286,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "北投區",
"title": "三合街0937900396北投奇岩公園捷運山景",
"area": "56.3",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3889921.html",
"cover_src": "https://cp2.591.com.tw/house/active/2017/03/17/148975416617053607_374x269.jpg",
"princ_single": 69.42,
"patterns": "3房2廳2衛1陽台",
"patterns_room": "3",
"patterns_hall": "2",
"patterns_bathroom": "2",
"patterns_balcony": "1",
"house_type": "公寓",
"house_usefor": "住宅",
"floor_at": "4",
"floor_total": "9",
"houseage": "1個月",
"houseage_count": 0.08333333333333333,
"area_woparking": 43.599999999999994,
"parking": "12.7坪(平面式,已含售金內)",
"area_parking": 12.7,
"community": "北投奇岩重劃區",
"addressSegment": "台北市北投區三合街",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3889921&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3889921&s=j_edit_maps",
"lat": 25.1267991,
"lng": 121.5052056,
"price_total": 3288.0,
"visited": 1563,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "內湖區",
"title": "港墘路捷運港墘站~麗山學區~湖光山色~心曠神怡",
"area": "26.6",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-4038339.html",
"cover_src": "https://cp1.591.com.tw/house/active/2017/02/07/148644691105693104_374x269.jpg",
"princ_single": 52.52,
"patterns": "3房2廳2衛1陽台",
"patterns_room": "3",
"patterns_hall": "2",
"patterns_bathroom": "2",
"patterns_balcony": "1",
"house_type": "公寓",
"house_usefor": "住宅",
"floor_at": "3",
"floor_total": "5",
"houseage": "33年",
"houseage_count": 33,
"parking": "無",
"addressSegment": "台北市內湖區港墘路",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=4038339&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=4038339&s=j_edit_maps",
"lat": 25.0802895,
"lng": 121.5773292,
"price_total": 1398.0,
"visited": 510,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "內湖區",
"title": "行善路383巷台北市內湖區新潤悅峰",
"area": "66.9",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3940893.html",
"cover_src": "https://cp1.591.com.tw/house/active/2017/05/23/149552220801685606_374x269.jpg",
"princ_single": 58.42,
"patterns": "4房2廳2衛1陽台",
"patterns_room": "4",
"patterns_hall": "2",
"patterns_bathroom": "2",
"patterns_balcony": "1",
"house_type": "電梯大樓",
"house_usefor": "住宅",
"floor_at": "4",
"floor_total": "11",
"houseage": "7年",
"houseage_count": 7,
"parking": "11.03坪(平面式,已含售金內)",
"area_parking": 11.03,
"area_woparking": 55.870000000000005,
"community": "新潤悅峰",
"addressSegment": "台北市內湖區行善路383巷",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3940893&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3940893&s=j_edit_maps",
"lat": 25.0638215,
"lng": 121.585747,
"price_total": 3908.0,
"visited": 890,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "內湖區",
"title": "金龍路222巷適合單身或小家庭,屋況佳可立即入住",
"area": "19.5",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-4015520.html",
"cover_src": "https://cp1.591.com.tw/house/active/2017/05/04/149382738497078608_374x269.jpg",
"princ_single": 58.94,
"patterns": "2房1廳1衛1陽台",
"patterns_room": "2",
"patterns_hall": "1",
"patterns_bathroom": "1",
"patterns_balcony": "1",
"house_type": "電梯大樓",
"house_usefor": "住宅",
"floor_at": "4",
"floor_total": "12",
"houseage": "23年",
"houseage_count": 23,
"parking": "無",
"community": "昇陽大地(查看更多待售物件)",
"addressSegment": "台北市內湖區金龍路222巷",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=4015520&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=4015520&s=j_edit_maps",
"lat": 25.0878849,
"lng": 121.5856857,
"price_total": 1150.0,
"visited": 1244,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "南港區",
"title": "經貿二路誠售~東方晶采2房車BA7630",
"area": "35.5",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-4075629.html",
"cover_src": "https://cp2.591.com.tw/house/active/2017/01/13/148427206904700602_374x269.jpg",
"princ_single": 71.28,
"patterns": "2房2廳1衛2陽台",
"patterns_room": "2",
"patterns_hall": "2",
"patterns_bathroom": "1",
"patterns_balcony": "2",
"house_type": "電梯大樓",
"house_usefor": "住宅",
"floor_at": "5",
"floor_total": "13",
"houseage": "4年",
"houseage_count": 4,
"area_woparking": 28.87,
"parking": "6.63坪(機械式,已含售金內)",
"area_parking": 6.63,
"community": "東方晶采(查看更多待售物件)",
"addressSegment": "台北市南港區經貿二路",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=4075629&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=4075629&s=j_edit_maps",
"lat": 25.0583932,
"lng": 121.6175076,
"price_total": 2240.0,
"visited": 78,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "松山區",
"title": "北寧路全新建案裝潢時尚兩房小豪宅離捷運100M",
"area": "35.2",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3910283.html",
"cover_src": "https://cp2.591.com.tw/house/active/2016/06/13/146579101359047603_374x269.jpg",
"princ_single": 123.58,
"patterns": "2房1廳1衛1陽台",
"patterns_room": "2",
"patterns_hall": "1",
"patterns_bathroom": "1",
"patterns_balcony": "1",
"house_type": "電梯大樓",
"house_usefor": "住宅",
"floor_at": "6",
"floor_total": "10",
"houseage": "1年",
"houseage_count": 1,
"parking": "6.79坪(機械式,已含售金內)",
"area_parking": 6.79,
"area_woparking": 28.410000000000004,
"addressSegment": "台北市松山區北寧路",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3910283&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3910283&s=j_edit_maps",
"lat": 25.04888,
"lng": 121.552762,
"price_total": 4350.0,
"visited": 1147,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "中正區",
"title": "愛國東路74巷中正御品-教大附小及中正國中雙優學區套房",
"area": "10",
"usefor": "套房",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3913299.html",
"cover_src": "https://cp1.591.com.tw/house/active/2017/03/25/149042020848008700_374x269.jpg",
"princ_single": 125.0,
"patterns": "1房1廳1衛",
"patterns_room": "1",
"patterns_hall": "1",
"patterns_bathroom": "1",
"house_type": "電梯大樓",
"house_usefor": "套房",
"floor_at": "8",
"floor_total": "8",
"houseage": "9年",
"houseage_count": 9,
"area_woparking": 10.68,
"parking": "無",
"community": "中正御品(查看更多待售物件)",
"addressSegment": "台北市中正區愛國東路74巷25號",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3913299&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3913299&s=j_edit_maps",
"lat": 25.0332317,
"lng": 121.5194855,
"price_total": 1250.0,
"visited": 1668,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "中山區",
"title": "林森北路399巷【小巢KIKI推薦】A45林森北美套房",
"area": "14.5",
"usefor": "套房",
"url_houseitem": "https://sale.591.com.tw/sale-detail-4061729.html",
"cover_src": "https://cp2.591.com.tw/house/active/2017/05/18/149509824234760307_374x269.jpg",
"princ_single": 58.54,
"patterns": "1房1廳1衛",
"patterns_room": "1",
"patterns_hall": "1",
"patterns_bathroom": "1",
"house_type": "電梯大樓",
"house_usefor": "套房",
"floor_at": "13",
"floor_total": "13",
"houseage": "32年",
"houseage_count": 32,
"area_woparking": 14.52,
"parking": "無",
"addressSegment": "台北市中山區林森北路399巷",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=4061729&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=4061729&s=j_edit_maps",
"lat": 25.0598039,
"lng": 121.5269146,
"price_total": 850.0,
"visited": 154,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "文山區",
"title": "景華街128巷景興國小旁公寓(屋況好、空間大、非輻射)",
"area": "29.8",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3999815.html",
"cover_src": "https://cp2.591.com.tw/house/active/2017/04/27/149325146635723108_374x269.jpg",
"princ_single": 50.35,
"patterns": "3房2廳2衛2陽台",
"patterns_room": "3",
"patterns_hall": "2",
"patterns_bathroom": "2",
"patterns_balcony": "2",
"house_type": "公寓",
"house_usefor": "住宅",
"floor_at": "4",
"floor_total": "5",
"houseage": "33年",
"houseage_count": 33,
"area_woparking": 29.8,
"parking": "無",
"addressSegment": "台北市文山區景華街128巷",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3999815&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3999815&s=j_edit_maps",
"lat": 24.996024,
"lng": 121.547708,
"price_total": 1500.0,
"visited": 946,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "士林區",
"title": "承德路四段12巷自售劍潭一樓門前停車使用超43坪適寵物",
"area": "43",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3837246.html",
"cover_src": "https://cp1.591.com.tw/house/active/2017/03/19/148990700568132900_374x269.jpg",
"princ_single": 64.65,
"patterns": "4房2廳2衛2陽台",
"patterns_room": "4",
"patterns_hall": "2",
"patterns_bathroom": "2",
"patterns_balcony": "2",
"house_type": "店面(店鋪)",
"house_usefor": "住宅",
"floor_at": "1",
"floor_total": "4",
"houseage": "40年",
"houseage_count": 40,
"area_woparking": 28.3,
"parking": "平面式,已含售金內",
"addressSegment": "台北市士林區承德路四段12巷",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3837246&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3837246&s=j_edit_maps",
"lat": 25.0807333,
"lng": 121.5202689,
"price_total": 2780.0,
"visited": 3871,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "北投區",
"title": "石牌路二段348巷《自售》石牌天母榮總優質套房",
"area": "15.8",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3969443.html",
"cover_src": "https://cp1.591.com.tw/house/active/2017/04/16/149230832312451803_374x269.jpg",
"princ_single": 62.06,
"patterns": "1房1廳1衛",
"patterns_room": "1",
"patterns_hall": "1",
"patterns_bathroom": "1",
"house_type": "電梯大樓",
"house_usefor": "住宅",
"floor_at": "1",
"floor_total": "6",
"houseage": "24年",
"houseage_count": 24,
"parking": "無",
"addressSegment": "台北市北投區石牌路二段348巷25-1號",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3969443&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3969443&s=j_edit_maps",
"lat": 25.1211774,
"lng": 121.5239655,
"price_total": 980.0,
"visited": 1952,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "萬華區",
"title": "西藏路復華花園大器4房+坡坪大車位~超值難得!",
"area": "64.3",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-4012940.html",
"cover_src": "https://cp2.591.com.tw/house/active/2017/05/05/149395620472723307_374x269.jpg",
"princ_single": 55.68,
"patterns": "4房2廳2衛3陽台",
"patterns_room": "4",
"patterns_hall": "2",
"patterns_bathroom": "2",
"patterns_balcony": "3",
"house_type": "電梯大樓",
"house_usefor": "住宅",
"floor_at": "4",
"floor_total": "15",
"houseage": "5年",
"houseage_count": 5,
"area_woparking": 64.25999999999999,
"parking": "平面式,已含售金內",
"community": "復華花園新城(查看更多待售物件)",
"addressSegment": "台北市萬華區西藏路",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=4012940&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=4012940&s=j_edit_maps",
"lat": 25.0304443,
"lng": 121.5038943,
"price_total": 3580.0,
"visited": 454,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "信義區",
"title": "松山路捷運永春站中庭管理電梯平面2房低總價",
"area": "20.7",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3973569.html",
"cover_src": "https://cp2.591.com.tw/house/active/2017/04/17/149241972424854105_374x269.jpg",
"princ_single": 58.0,
"patterns": "2房2廳1衛",
"patterns_room": "2",
"patterns_hall": "2",
"patterns_bathroom": "1",
"house_type": "電梯大樓",
"house_usefor": "住宅",
"floor_at": "3",
"floor_total": "15",
"houseage": "32年",
"houseage_count": 32,
"area_woparking": 20.689999999999998,
"parking": "無",
"community": "永春大樓(查看更多待售物件)",
"addressSegment": "台北市信義區松山路",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3973569&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3973569&s=j_edit_maps",
"lat": 25.0438579,
"lng": 121.5775502,
"price_total": 1200.0,
"visited": 1747,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "信義區",
"title": "吳興街自售華廈全新電梯大樓三房含車位可議價",
"area": "37.4",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3934377.html",
"cover_src": "https://cp2.591.com.tw/house/active/2017/04/04/149123803588666207_374x269.jpg",
"princ_single": 77.01,
"patterns": "3房1廳2衛1陽台",
"patterns_room": "3",
"patterns_hall": "1",
"patterns_bathroom": "2",
"patterns_balcony": "1",
"house_type": "公寓",
"house_usefor": "住宅",
"floor_at": "5",
"floor_total": "9",
"houseage": "7個月",
"houseage_count": 0.5833333333333334,
"parking": "無",
"addressSegment": "台北市信義區吳興街516號",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3934377&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3934377&s=j_edit_maps",
"lat": 25.0223842,
"lng": 121.5690637,
"price_total": 2880.0,
"visited": 2838,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "松山區",
"title": "民權東路五段民權大橋邊,景觀可看見碧山巖",
"area": "34.6",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-4011139.html",
"cover_src": "https://cp1.591.com.tw/house/active/2017/05/01/149362763766177306_374x269.jpg",
"princ_single": 64.99,
"patterns": "3房2廳2衛2陽台",
"patterns_room": "3",
"patterns_hall": "2",
"patterns_bathroom": "2",
"patterns_balcony": "2",
"house_type": "公寓",
"house_usefor": "住宅",
"floor_at": "4",
"floor_total": "5",
"houseage": "38年",
"houseage_count": 38,
"parking": "無",
"addressSegment": "台北市松山區民權東路五段80號",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=4011139&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=4011139&s=j_edit_maps",
"lat": 25.0638467,
"lng": 121.5674197,
"price_total": 2250.0,
"visited": 832,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "大安區",
"title": "信義路四段265巷(雙仁愛學區)小君悅稀有高樓面公園釋出",
"area": "10",
"usefor": "套房",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3999596.html",
"cover_src": "https://cp2.591.com.tw/house/active/2017/04/26/149321145122787804_374x269.jpg",
"princ_single": 119.04,
"patterns": "1房1廳1衛",
"patterns_room": "1",
"patterns_hall": "1",
"patterns_bathroom": "1",
"house_type": "電梯大樓",
"house_usefor": "套房",
"floor_at": "9",
"floor_total": "13",
"houseage": "8年",
"houseage_count": 8,
"area_woparking": 9.98,
"parking": "無",
"community": "小君悅(查看更多待售物件)",
"addressSegment": "台北市大安區信義路四段265巷",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3999596&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3999596&s=j_edit_maps",
"lat": 25.0341568,
"lng": 121.5546012,
"price_total": 1188.0,
"visited": 675,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "文山區",
"title": "政大一街320巷政大附中優質社區,稀有釋出,福氣溫馨別墅",
"area": "69.6",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3977299.html",
"cover_src": "https://cp1.591.com.tw/house/active/2016/11/07/147850399017583402_374x269.jpg",
"princ_single": 49.58,
"patterns": "5房2廳2衛2陽台",
"patterns_room": "5",
"patterns_hall": "2",
"patterns_bathroom": "2",
"patterns_balcony": "2",
"house_type": "別墅",
"house_usefor": "住宅",
"floor_at": "整棟",
"floor_total": "4",
"houseage": "17年",
"houseage_count": 17,
"parking": "平面式,已含售金內",
"addressSegment": "台北市文山區政大一街320巷",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3977299&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3977299&s=j_edit_maps",
"lat": 24.9867086,
"lng": 121.5860899,
"price_total": 3450.0,
"visited": 912,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "中正區",
"title": "中華路一段中華帝標台北車站高投報方正套房",
"area": "17.3",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3924199.html",
"cover_src": "https://cp1.591.com.tw/house/active/2017/03/30/149084905123101104_374x269.jpg",
"princ_single": 89.85,
"patterns": "1房2廳1衛1陽台",
"patterns_room": "1",
"patterns_hall": "2",
"patterns_bathroom": "1",
"patterns_balcony": "1",
"house_type": "電梯大樓",
"house_usefor": "住宅",
"floor_at": "10",
"floor_total": "15",
"houseage": "1年",
"houseage_count": 1,
"area_woparking": 17.34,
"parking": "無",
"community": "中華帝標(查看更多待售物件)",
"addressSegment": "台北市中正區中華路一段7號",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3924199&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3924199&s=j_edit_maps",
"lat": 25.0471725,
"lng": 121.5102053,
"price_total": 1558.0,
"visited": 905,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "北投區",
"title": "致遠一路一段現代簡約時尚宅買屋帶租約現買現做包租公",
"area": "24.6",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-4015100.html",
"cover_src": "https://cp2.591.com.tw/house/active/2017/05/03/149377366539642303_374x269.jpg",
"princ_single": 73.45,
"patterns": "1房1廳1衛",
"patterns_room": "1",
"patterns_hall": "1",
"patterns_bathroom": "1",
"house_type": "電梯大樓",
"house_usefor": "住宅",
"floor_at": "2",
"floor_total": "7",
"houseage": "3年",
"houseage_count": 3,
"area_woparking": 19.060000000000002,
"parking": "5.54坪(機械式,已含售金內)",
"area_parking": 5.54,
"community": "青木淳(查看更多待售物件)",
"addressSegment": "台北市北投區致遠一路一段",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=4015100&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=4015100&s=j_edit_maps",
"lat": 25.1083115,
"lng": 121.5148615,
"price_total": 1620.0,
"visited": 605,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "中正區",
"title": "杭州南路一段<自售>華山美妝庭園車庫一樓",
"area": "64.1",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-4040211.html",
"cover_src": "https://cp2.591.com.tw/house/active/2017/05/12/149451954051657707_374x269.jpg",
"princ_single": 107.38,
"patterns": "5房3廳1衛1陽台",
"patterns_room": "5",
"patterns_hall": "3",
"patterns_bathroom": "1",
"patterns_balcony": "1",
"house_type": "公寓",
"house_usefor": "住宅",
"floor_at": "1",
"floor_total": "6",
"houseage": "40年",
"houseage_count": 40,
"parking": "平面式,已含售金內",
"addressSegment": "台北市中正區杭州南路一段",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=4040211&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=4040211&s=j_edit_maps",
"lat": 25.0387677,
"lng": 121.5283012,
"price_total": 6880.0,
"visited": 286,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "北投區",
"title": "三合街0937900396北投奇岩公園捷運山景",
"area": "56.3",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3889921.html",
"cover_src": "https://cp2.591.com.tw/house/active/2017/03/17/148975416617053607_374x269.jpg",
"princ_single": 69.42,
"patterns": "3房2廳2衛1陽台",
"patterns_room": "3",
"patterns_hall": "2",
"patterns_bathroom": "2",
"patterns_balcony": "1",
"house_type": "公寓",
"house_usefor": "住宅",
"floor_at": "4",
"floor_total": "9",
"houseage": "1個月",
"houseage_count": 0.08333333333333333,
"area_woparking": 43.599999999999994,
"parking": "12.7坪(平面式,已含售金內)",
"area_parking": 12.7,
"community": "北投奇岩重劃區",
"addressSegment": "台北市北投區三合街",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3889921&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3889921&s=j_edit_maps",
"lat": 25.1267991,
"lng": 121.5052056,
"price_total": 3288.0,
"visited": 1563,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "內湖區",
"title": "港墘路捷運港墘站~麗山學區~湖光山色~心曠神怡",
"area": "26.6",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-4038339.html",
"cover_src": "https://cp1.591.com.tw/house/active/2017/02/07/148644691105693104_374x269.jpg",
"princ_single": 52.52,
"patterns": "3房2廳2衛1陽台",
"patterns_room": "3",
"patterns_hall": "2",
"patterns_bathroom": "2",
"patterns_balcony": "1",
"house_type": "公寓",
"house_usefor": "住宅",
"floor_at": "3",
"floor_total": "5",
"houseage": "33年",
"houseage_count": 33,
"parking": "無",
"addressSegment": "台北市內湖區港墘路",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=4038339&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=4038339&s=j_edit_maps",
"lat": 25.0802895,
"lng": 121.5773292,
"price_total": 1398.0,
"visited": 510,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "內湖區",
"title": "行善路383巷台北市內湖區新潤悅峰",
"area": "66.9",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3940893.html",
"cover_src": "https://cp1.591.com.tw/house/active/2017/05/23/149552220801685606_374x269.jpg",
"princ_single": 58.42,
"patterns": "4房2廳2衛1陽台",
"patterns_room": "4",
"patterns_hall": "2",
"patterns_bathroom": "2",
"patterns_balcony": "1",
"house_type": "電梯大樓",
"house_usefor": "住宅",
"floor_at": "4",
"floor_total": "11",
"houseage": "7年",
"houseage_count": 7,
"parking": "11.03坪(平面式,已含售金內)",
"area_parking": 11.03,
"area_woparking": 55.870000000000005,
"community": "新潤悅峰",
"addressSegment": "台北市內湖區行善路383巷",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3940893&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3940893&s=j_edit_maps",
"lat": 25.0638215,
"lng": 121.585747,
"price_total": 3908.0,
"visited": 890,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "內湖區",
"title": "金龍路222巷適合單身或小家庭,屋況佳可立即入住",
"area": "19.5",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-4015520.html",
"cover_src": "https://cp1.591.com.tw/house/active/2017/05/04/149382738497078608_374x269.jpg",
"princ_single": 58.94,
"patterns": "2房1廳1衛1陽台",
"patterns_room": "2",
"patterns_hall": "1",
"patterns_bathroom": "1",
"patterns_balcony": "1",
"house_type": "電梯大樓",
"house_usefor": "住宅",
"floor_at": "4",
"floor_total": "12",
"houseage": "23年",
"houseage_count": 23,
"parking": "無",
"community": "昇陽大地(查看更多待售物件)",
"addressSegment": "台北市內湖區金龍路222巷",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=4015520&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=4015520&s=j_edit_maps",
"lat": 25.0878849,
"lng": 121.5856857,
"price_total": 1150.0,
"visited": 1244,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "南港區",
"title": "經貿二路誠售~東方晶采2房車BA7630",
"area": "35.5",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-4075629.html",
"cover_src": "https://cp2.591.com.tw/house/active/2017/01/13/148427206904700602_374x269.jpg",
"princ_single": 71.28,
"patterns": "2房2廳1衛2陽台",
"patterns_room": "2",
"patterns_hall": "2",
"patterns_bathroom": "1",
"patterns_balcony": "2",
"house_type": "電梯大樓",
"house_usefor": "住宅",
"floor_at": "5",
"floor_total": "13",
"houseage": "4年",
"houseage_count": 4,
"area_woparking": 28.87,
"parking": "6.63坪(機械式,已含售金內)",
"area_parking": 6.63,
"community": "東方晶采(查看更多待售物件)",
"addressSegment": "台北市南港區經貿二路",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=4075629&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=4075629&s=j_edit_maps",
"lat": 25.0583932,
"lng": 121.6175076,
"price_total": 2240.0,
"visited": 78,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "松山區",
"title": "北寧路全新建案裝潢時尚兩房小豪宅離捷運100M",
"area": "35.2",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3910283.html",
"cover_src": "https://cp2.591.com.tw/house/active/2016/06/13/146579101359047603_374x269.jpg",
"princ_single": 123.58,
"patterns": "2房1廳1衛1陽台",
"patterns_room": "2",
"patterns_hall": "1",
"patterns_bathroom": "1",
"patterns_balcony": "1",
"house_type": "電梯大樓",
"house_usefor": "住宅",
"floor_at": "6",
"floor_total": "10",
"houseage": "1年",
"houseage_count": 1,
"parking": "6.79坪(機械式,已含售金內)",
"area_parking": 6.79,
"area_woparking": 28.410000000000004,
"addressSegment": "台北市松山區北寧路",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3910283&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3910283&s=j_edit_maps",
"lat": 25.04888,
"lng": 121.552762,
"price_total": 4350.0,
"visited": 1147,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "中正區",
"title": "愛國東路74巷中正御品-教大附小及中正國中雙優學區套房",
"area": "10",
"usefor": "套房",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3913299.html",
"cover_src": "https://cp1.591.com.tw/house/active/2017/03/25/149042020848008700_374x269.jpg",
"princ_single": 125.0,
"patterns": "1房1廳1衛",
"patterns_room": "1",
"patterns_hall": "1",
"patterns_bathroom": "1",
"house_type": "電梯大樓",
"house_usefor": "套房",
"floor_at": "8",
"floor_total": "8",
"houseage": "9年",
"houseage_count": 9,
"area_woparking": 10.68,
"parking": "無",
"community": "中正御品(查看更多待售物件)",
"addressSegment": "台北市中正區愛國東路74巷25號",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3913299&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3913299&s=j_edit_maps",
"lat": 25.0332317,
"lng": 121.5194855,
"price_total": 1250.0,
"visited": 1668,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "中山區",
"title": "林森北路399巷【小巢KIKI推薦】A45林森北美套房",
"area": "14.5",
"usefor": "套房",
"url_houseitem": "https://sale.591.com.tw/sale-detail-4061729.html",
"cover_src": "https://cp2.591.com.tw/house/active/2017/05/18/149509824234760307_374x269.jpg",
"princ_single": 58.54,
"patterns": "1房1廳1衛",
"patterns_room": "1",
"patterns_hall": "1",
"patterns_bathroom": "1",
"house_type": "電梯大樓",
"house_usefor": "套房",
"floor_at": "13",
"floor_total": "13",
"houseage": "32年",
"houseage_count": 32,
"area_woparking": 14.52,
"parking": "無",
"addressSegment": "台北市中山區林森北路399巷",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=4061729&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=4061729&s=j_edit_maps",
"lat": 25.0598039,
"lng": 121.5269146,
"price_total": 850.0,
"visited": 154,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "文山區",
"title": "景華街128巷景興國小旁公寓(屋況好、空間大、非輻射)",
"area": "29.8",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3999815.html",
"cover_src": "https://cp2.591.com.tw/house/active/2017/04/27/149325146635723108_374x269.jpg",
"princ_single": 50.35,
"patterns": "3房2廳2衛2陽台",
"patterns_room": "3",
"patterns_hall": "2",
"patterns_bathroom": "2",
"patterns_balcony": "2",
"house_type": "公寓",
"house_usefor": "住宅",
"floor_at": "4",
"floor_total": "5",
"houseage": "33年",
"houseage_count": 33,
"area_woparking": 29.8,
"parking": "無",
"addressSegment": "台北市文山區景華街128巷",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3999815&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3999815&s=j_edit_maps",
"lat": 24.996024,
"lng": 121.547708,
"price_total": 1500.0,
"visited": 946,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "士林區",
"title": "承德路四段12巷自售劍潭一樓門前停車使用超43坪適寵物",
"area": "43",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3837246.html",
"cover_src": "https://cp1.591.com.tw/house/active/2017/03/19/148990700568132900_374x269.jpg",
"princ_single": 64.65,
"patterns": "4房2廳2衛2陽台",
"patterns_room": "4",
"patterns_hall": "2",
"patterns_bathroom": "2",
"patterns_balcony": "2",
"house_type": "店面(店鋪)",
"house_usefor": "住宅",
"floor_at": "1",
"floor_total": "4",
"houseage": "40年",
"houseage_count": 40,
"area_woparking": 28.3,
"parking": "平面式,已含售金內",
"addressSegment": "台北市士林區承德路四段12巷",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3837246&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3837246&s=j_edit_maps",
"lat": 25.0807333,
"lng": 121.5202689,
"price_total": 2780.0,
"visited": 3871,
"updatemoment": "今日"
},
{
"city": "台北市",
"district": "北投區",
"title": "石牌路二段348巷《自售》石牌天母榮總優質套房",
"area": "15.8",
"usefor": "住宅",
"url_houseitem": "https://sale.591.com.tw/sale-detail-3969443.html",
"cover_src": "https://cp1.591.com.tw/house/active/2017/04/16/149230832312451803_374x269.jpg",
"princ_single": 62.06,
"patterns": "1房1廳1衛",
"patterns_room": "1",
"patterns_hall": "1",
"patterns_bathroom": "1",
"house_type": "電梯大樓",
"house_usefor": "住宅",
"floor_at": "1",
"floor_total": "6",
"houseage": "24年",
"houseage_count": 24,
"parking": "無",
"addressSegment": "台北市北投區石牌路二段348巷25-1號",
"url_streetmap": "https://sale.591.com.tw/map-street.html?type=2&post_id=3969443&detail=detail",
"url_housemap": "https://sale.591.com.tw/map-houseRound.html?type=2&post_id=3969443&s=j_edit_maps",
"lat": 25.1211774,
"lng": 121.5239655,
"price_total": 980.0,
"visited": 1952,
"updatemoment": "今日"
}
]
@keitheis
Copy link

flake8 dbstore.py
dbstore.py:2:1: F401 'os' imported but unused
dbstore.py:6:1: F401 'time' imported but unused
dbstore.py:9:1: F403 'from phpserialize import *' used; unable to detect undefined names
dbstore.py:9:1: F401 'phpserialize.*' imported but unused
dbstore.py:12:1: E302 expected 2 blank lines, found 1
dbstore.py:16:17: E225 missing whitespace around operator
dbstore.py:20:1: W293 blank line contains whitespace
dbstore.py:21:5: E303 too many blank lines (2)
dbstore.py:29:20: E225 missing whitespace around operator
dbstore.py:30:27: E225 missing whitespace around operator
dbstore.py:33:26: E225 missing whitespace around operator
dbstore.py:33:35: E231 missing whitespace after ','
dbstore.py:35:26: E225 missing whitespace around operator
dbstore.py:37:20: E231 missing whitespace after ','
dbstore.py:38:24: E225 missing whitespace around operator
dbstore.py:39:24: E225 missing whitespace around operator
dbstore.py:45:43: E225 missing whitespace around operator
dbstore.py:46:34: E225 missing whitespace around operator
dbstore.py:48:43: E225 missing whitespace around operator
dbstore.py:49:34: E225 missing whitespace around operator
dbstore.py:51:20: E225 missing whitespace around operator
dbstore.py:51:80: E501 line too long (90 > 79 characters)
dbstore.py:70:28: E231 missing whitespace after ','
dbstore.py:72:1: W293 blank line contains whitespace
dbstore.py:73:1: E305 expected 2 blank lines after class or function definition, found 1
dbstore.py:81:12: E201 whitespace after '('
dbstore.py:81:35: E202 whitespace before ')'
dbstore.py:82:12: E201 whitespace after '('
dbstore.py:82:34: E202 whitespace before ')'

@keitheis
Copy link

keitheis commented May 31, 2017

flake8 噴多少行就是程式有多不好讀~

一.可以試試把 59 行移掉

-                     self.CRAWLDICT.remove(crawdata)

或二.37 行處改成

            crawled_copy = self.CRAWLDICT.copy()
            for index, crawdata in enumerate(crawled_copy):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment