-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: 'portland' is not a valid site #106
Comments
Hey @chrismd1, so first of all, 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: [email protected]\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})
# You can get an approximate amount of results with the following call:
print(cl_h.get_results_approx_count())
Thanks,
Chris
…On Wed, Feb 24, 2021 at 10:01 AM Ira Horecka ***@***.***> 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: ***@***.***\n'
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#106 (comment)>,
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
The text was updated successfully, but these errors were encountered: