HexNio / booking_scraper

A booking.com Web Scraper for Data Mining/Harvesting and Automation
GNU General Public License v3.0
32 stars 23 forks source link

the saved json file is empty #5

Open fatimakashakesh opened 1 year ago

fatimakashakesh commented 1 year ago

i run the code but the file was empty

fatimakashakesh commented 1 year ago

when running the code i get this error File "C:\Users\pc\AppData\Local\Programs\Python\Python311\venv\test.py", line 5, in result = bkscraper.get_result(city="New York", limit=1, detail=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\pc\AppData\Local\Programs\Python\Python311\venv\Lib\site-packages\booking_scraper\bkscraper.py", line 175, in get_result result = process_data(people, country, city, datein, dateout, is_detail, limit) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\pc\AppData\Local\Programs\Python\Python311\venv\Lib\site-packages\booking_scraper\bkscraper.py", line 65, in process_data max_off = int(get_max_offset(soup)) ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\pc\AppData\Local\Programs\Python\Python311\venv\Lib\site-packages\booking_scraper\bkscraper.py", line 24, in get_max_offset all_offset = soup.find_all('li', {'class': 'sr_pagination_item'})[-1].get_text().splitlines()[-1]


IndexError: list index out of range
fatimakashakesh commented 1 year ago

in process_data max_offset = int(get_max_offset(soup)) ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\pc\AppData\Local\Programs\Python\Python311\venv\bkscraper.py", line 24, in get_max_offset all_offset = soup.find_all('li', {'class': 'sr_pagination_item'})[-1].get_text().splitlines()[-1]


IndexError: list index out of range
danielbenjamins commented 7 months ago

Same problem (empty json file) here, but no errors