Open chrismdavis opened 3 years ago
Hey @chrismd1, so first of all, housing_type
is not a valid filter.
The resulting url generated by your query is https://portland.craigslist.org/search/apa?searchNearby=1&max_price=2000&min_price=1200&postedToday=1&search_distance=15&postal=97215&s=0
Unfortunately, it seems like Craigslist blocked my IP address (HTTP 403 Forbidden client error). You can try this to see if you have the same results:
import requests
search_url = "https://portland.craigslist.org/search/apa?searchNearby=1&max_price=2000&min_price=1200&postedToday=1&search_distance=15&postal=97215&s=0"
print(requests.get(search_url).status_code)
print(requests.get(search_url).text)
>>> 403
>>> 'This IP has been automatically blocked.\nIf you have questions, please email: blocks-b1613521966357929@craigslist.org\n'
Hi Ira,
Thanks for responding. Of note - the example code from the package information page https://pypi.org/project/python-craigslist/ also returns the same result ('...ValueError: 'sfbay' is not a valid site'). I've removed the 'housetype' filter and still can't avoid this error.
from craigslist import CraigslistHousing
cl_h = CraigslistHousing(site='sfbay', area='sfc', category='roo', filters={'max_price': 1200, 'private_room': True})
print(cl_h.get_results_approx_count())
Thanks, Chris
On Wed, Feb 24, 2021 at 10:01 AM Ira Horecka notifications@github.com wrote:
Hey @chrismd1 https://github.com/chrismd1, so first of all, housing_type is not a valid filter. The resulting url generated by your query is https://portland.craigslist.org/search/apa?searchNearby=1&max_price=2000&min_price=1200&postedToday=1&search_distance=15&postal=97215&s=0
Unfortunately, it seems like Craigslist blocked my IP address (HTTP 403 Forbidden client error). You can try this to see if you have the same results:
import requestssearch_url = "https://portland.craigslist.org/search/apa?searchNearby=1&max_price=2000&min_price=1200&postedToday=1&search_distance=15&postal=97215&s=0" print(requests.get(search_url).status_code)print(requests.get(search_url).text)
403>>> 'This IP has been automatically blocked.\nIf you have questions, please email: blocks-b1613521966357929@craigslist.org\n'
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/juliomalegria/python-craigslist/issues/106#issuecomment-785264695, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGSL2RJPELJJ4TEUR6RZS23TAU5JHANCNFSM4YE3AJ6A .
Hey @chrismd1 I apologize, my maladies was tied with issue #105. Is your issue still persistent?
Hey @chrismd1.
I just tried this and this works just fine for me.
Can you run this to double-check that the library is getting the sites correctly?
In [1]: from craigslist import utils
In [2]: len(utils.get_all_sites())
Out[2]: 708
Can you try that and tell me what you get? Thanks.
Getting the following error including when ran with default site 'sfbay'. Was working as recent as yesterday: Thanks