Closed rebelhazzard closed 6 years ago
Looking in the code it looks like there's currently no way to tell it to search all sites. You'd just have to call it twice and display the results for each.
This will have to make 2 calls to 2 different URLs, so I think is more transparent to instantiate two objects and call get_results
twice. You could then chain the generators returned like so:
import itertools
cl_vancouver = CraigslistForSale(site='vancouver', ...)
cl_toronto = CraigslistForSale(site='toronto', ...)
for results in itertools.chain(cl_vancouver.get_results(), cl_toronto.get_results()):
print result
cl_h = CraigslistForSale(site='vancouver', 'toronto' area='', category='cto',
I want to be able to use multiple sites like the above, instead of just searching vancouver I want to be able to search toronto too.
how can i do this?
thanks