I want to **scrape** the data from the booking.com but got some errors and couldn't find any similar codes.
I want to **scrape** the name of the hotel,price and etc.

i have tried beautifulSoup 4 and tried to get data to a csv file.

```
import requests
from bs4 import BeautifulSoup
import pandas

# Replace search_url with a valid one byb visiting and searching booking.com
search_url = 'https://www.booking.com/searchresults.....'
page = requests.get(search_url)
soup = BeautifulSoup(page.content, 'html.parser')

week = soup.find(id = 'search_results_table'  )
#print(week)

items = week.find_all(class_='sr-hotel__name')
print(items[0])
print(items[0].find(class_ = 'sr-hotel__name').get_text())
print(items[0].find(class_ = 'short-desc').get_text())

```

[Here](https://www.booking.com/searchresults.en-us.html?label=gen173nr-1FCAEoggI46AdIM1gEaGyIAQGYATG4ARnIAQzYAQHoAQH4AQKIAgGoAgO4AsH15uwFwAIB&sid=03a9005d93d972589bb54b4ef29981e9&sb=1&src=index&src_elem=sb&error_url=https%3A%2F%2Fwww.booking.com%2Findex.html%3Flabel%3Dgen173nr-1FCAEoggI46AdIM1gEaGyIAQGYATG4ARnIAQzYAQHoAQH4AQKIAgGoAgO4AsH15uwFwAIB%3Bsid%3D03a9005d93d972589bb54b4ef29981e9%3Bsb_price_type%3Dtotal%26%3B&ss=Pune%2C+Maharashtra%2C+India&is_ski_area=&checkin_month=10&checkin_monthday=6&checkin_year=2019&checkout_month=10&checkout_monthday=8&checkout_year=2019&group_adults=2&group_children=0&no_rooms=1&b_h4u_keep_filters=&from_sf=1&ss_raw=pune&ac_position=0&ac_langcode=en&ac_click_type=b&dest_id=-2108361&dest_type=city&iata=PNQ&place_id_lat=18.5204&place_id_lon=73.8567&search_pageview_id=fc9646200c03010c&search_selected=true&search_pageview_id=fc9646200c03010c&ac_suggestion_list_length=5&ac_suggestion_theme_list_length=0&order=) is a sample URL that can be used in place of `search_url`.

**This is the error msg...**

```
<span class="sr-hotel__name " data-et-click="
">
The Fort Printers
</span>
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-44-77b38c8546bb> in <module>
     11 items = week.find_all(class_='sr-hotel__name')
     12 print(items[0])
---> 13 print(items[0].find(class_ = 'sr-hotel__name').get_text())
     14 print(items[0].find(class_ = 'short-desc').get_text())
     15 

AttributeError: 'NoneType' object has no attribute 'get_text'

```