digital-engineering / airbnb-scraper

Airbnb Scraper: Advanced Airbnb Search using Scrapy
GNU General Public License v3.0
190 stars 66 forks source link

MINIMUM_MONTHLY_DISCOUNT on the airbnb site #12

Closed stephanedebove closed 3 years ago

stephanedebove commented 3 years ago

Hi,

thank you for this great work!

I was wondering if you know how to set up the MINIMUM_MONTHLY_DISCOUNT and MINIMUM_WEEKLY_DISCOUNT parameters while doing a regular search on the airbnb website? I tried adding this : &MINIMUM_MONTHLY_DISCOUNT=30 in the url but it didn’t work.

I also tried to run the example code you provide scrapy crawl airbnb -a query="Colorado Springs, CO" -o colorado_springs.csv after setting everything up on google colab but ran into the error:

2021-04-17 13:22:12 [airbnb] INFO: starting survey for: Colorado Springs, CO
2021-04-17 13:22:12 [scrapy.core.engine] ERROR: Error while obtaining start requests
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/scrapy/core/engine.py", line 129, in _next_request
    request = next(slot.start_requests)
  File "/content/airbnb-scraper/deepbnb/spiders/airbnb.py", line 136, in start_requests
    yield self.__explore_search.api_request(self.__query, params, self.__explore_search.parse_landing_page)
  File "/content/airbnb-scraper/deepbnb/api/ExploreSearch.py", line 63, in api_request
    headers = self._get_search_headers()
  File "/content/airbnb-scraper/deepbnb/api/ApiBase.py", line 61, in _get_search_headers
    'X-CSRF-Without-Token':             '1',
TypeError: unsupported operand type(s) for |: 'dict' and 'dict'
2021-04-17 13:22:12 [scrapy.core.engine] INFO: Closing spider (finished)

Any idea why? Thanks again!

digitalengineering commented 3 years ago

Hi @stephanedebove !

I was wondering if you know how to set up the MINIMUM_MONTHLY_DISCOUNT and MINIMUM_WEEKLY_DISCOUNT parameters while doing a regular search on the airbnb website?

AFAIK, it is not possible. Airbnb does not allow this functionality natively. In this project, MINIMUM_WEEKLY_DISCOUNT and MINIMUM_WEEKLY_DISCOUNT are used to post-process and filter the results received from Airbnb.

I also tried to run the example code you provide scrapy crawl airbnb -a query="Colorado Springs, CO" -o colorado_springs.csv after setting everything up on google colab but ran into the error:

I'm not familiar with Google Colab, but this looks like an issue with the Python version they are running. This project requires the latest Python version, 3.9. Lower versions of Python don't understand the |: operator.