title: How do I fix the code to scrape Zomato website?
body: <p>I wrote this code but got this as the error "IndexError: list index out of range" after running the last line. Please, how do I fix this?</p>
  
  <pre><code>    import requests
      from bs4 import BeautifulSoup
  
      headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, 
                                             like Gecko) Chrome/61.0.3163.100 Safari/537.36'}
      response = requests.get("https://www.zomato.com/bangalore/top-restaurants",headers=headers)
  
      content = response.content
      soup = BeautifulSoup(content,"html.parser")
  
      top_rest = soup.find_all("div",attrs={"class": "sc-bblaLu dOXFUL"})
      list_tr = top_rest[0].find_all("div",attrs={"class": "sc-gTAwTn cKXlHE"})
  
  list_rest =[]
  for tr in list_tr:
      dataframe ={}
      dataframe["rest_name"] = (tr.find("div",attrs={"class": "res_title zblack bold nowrap"})).text.replace('\n', ' ')
      dataframe["rest_address"] = (tr.find("div",attrs={"class": "nowrap grey-text fontsize5 ttupper"})).text.replace('\n', ' ')
      dataframe["cuisine_type"] = (tr.find("div",attrs={"class":"nowrap grey-text"})).text.replace('\n', ' ')
      list_rest.append(dataframe)
  list_rest
  </code></pre>