-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtest_multicity.py
50 lines (40 loc) · 1.62 KB
/
test_multicity.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
__author__ = "Sam Maurer, UrbanSim Inc"
__date__ = "May 6, 2016"
# This is a test script for the rental listing scraper
from datetime import datetime as dt
from datetime import timedelta
# add subfolder to system path
import sys
sys.path.insert(0, 'scraper2/')
import scraper2
# Craiglist regions that divide listings into by-owner vs. by-broker use a different
# URL ending -- 'aap' for 'all apartments' rather than 'apa' for 'apartments'.
domains = [
'http://atlanta.craigslist.org/search/apa',
'http://austin.craigslist.org/search/apa',
'http://boston.craigslist.org/search/aap',
'http://chicago.craigslist.org/search/apa',
'http://dallas.craigslist.org/search/apa',
'http://denver.craigslist.org/search/apa',
'http://detroit.craigslist.org/search/apa',
'http://houston.craigslist.org/search/apa',
'http://lasvegas.craigslist.org/search/apa',
'http://losangeles.craigslist.org/search/apa',
'http://miami.craigslist.org/search/apa',
'http://minneapolis.craigslist.org/search/apa',
'http://newyork.craigslist.org/search/aap',
'http://orangecounty.craigslist.org/search/apa',
'http://philadelphia.craigslist.org/search/apa',
'http://phoenix.craigslist.org/search/apa',
'http://portland.craigslist.org/search/apa',
'http://raleigh.craigslist.org/search/apa',
'http://sacramento.craigslist.org/search/apa',
'http://sandiego.craigslist.org/search/apa',
'http://seattle.craigslist.org/search/apa',
'http://sfbay.craigslist.org/search/apa',
'http://washingtondc.craigslist.org/search/apa']
s = scraper2.RentalListingScraper(
domains = domains,
earliest_ts = dt.now() - timedelta(hours=0.05),
latest_ts = dt.now())
s.run()