-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathscrawl.py
28 lines (24 loc) · 925 Bytes
/
scrawl.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import core
import model
import settings
import logging
def get_communitylist(city):
res = []
for community in model.Community.select():
if community.city == city:
res.append(community.title)
return res
if __name__ == "__main__":
logging.basicConfig(
format='%(asctime)s - %(levelname)s - %(message)s', level=logging.INFO)
regionlist = settings.REGIONLIST # only pinyin support
city = settings.CITY
model.database_init()
logging.info("Scrawling House Info")
core.GetHouseByRegionlist(city, regionlist)
# core.GetRentByRegionlist(city, regionlist)
# Init,scrapy celllist and insert database; could run only 1st time
# logging.info("Scrawling Community Info")
# core.GetCommunityByRegionlist(city, regionlist)
# communitylist = get_communitylist(city) # Read celllist from database
# core.GetSellByCommunitylist(city, communitylist)