title: Why is OUTPUT empty after scraping web site?
body: <p>Can website block python script to scan values from them (via BeautifulSoup)?</p>
  <p>I use this script</p>
  <pre><code>import gspread
  import requests
  from bs4 import BeautifulSoup
  
  URL = 'https://www.sreality.cz/hledani/prodej/byty/praha?velikost=1%2Bkk'
  page = requests.get(URL)
  soup = BeautifulSoup(page.content, 'html.parser')
  
  headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0'}
  response = requests.get(URL, headers=headers)
  
  #Scraping webu eurobydleni.cz
  results = soup.find_all('div', attrs={'class':'text-wrap'})
  for job in results:
  
      nemovitost = job.find('span', attrs={'class':'name ng-binding'})
      nemovitost_final = nemovitost.text.strip()
  
      print(nemovitost_final)
  </code></pre>
  <p>But OUTPUT is nothing. Script start then ends quickly.</p>
  <p>I need print what is in <code>&lt;span class=&quot;name ng-binding&quot;&gt;Prodej bytu 1+kk 33&amp;nbsp;m²&lt;/span&gt;</code></p>
  <p>So OUTPUT= 'Prodej bytu 1+kk', 'Prodej bytu 1+kk', others...</p>
  <p><strong>Edit: Use help from @Andrej Kesely:</strong></p>
  <p>I try our code (in my code to insert values to Google Sheet), but I got error.</p>
  <pre><code>import gspread
  import requests
  import datetime 
  import json
  from bs4 import BeautifulSoup
  from oauth2client.service_account import ServiceAccountCredentials
  from pprint import pprint
  from datetime import timedelta
  import time
  
  datetime.datetime.now()
  
  scope = [
  'https://www.googleapis.com/auth/spreadsheets',
  'https://www.googleapis.com/auth/drive'
  ]
  
  api_url = 'https://www.sreality.cz/api/cs/v2/estates?category_main_cb=1&amp;category_sub_cb=2&amp;category_type_cb=1&amp;locality_region_id=10&amp;per_page=20'
  data = requests.get(api_url).json()
  
  #komuniakce s Excelem
  data = ServiceAccountCredentials.from_json_keyfile_name(&quot;data.json&quot;, scope)
  client = gspread.authorize(data)
  sheet = client.open(&quot;skript&quot;).worksheet('sreality.cz')
  data = sheet.get_all_records()
  
  #zapis do LOG
  sheet2 = client.open(&quot;skript&quot;).worksheet('LOG')
  data = sheet2.get_all_records()
  
  insertRow = [&quot;sreality.cz&quot;, &quot;START: &quot; + str(datetime.datetime.now().strftime('%d-%m-%Y ve %H:%M:%S'))]
  sheet2.insert_row(insertRow,2)
  
  for estate in data[&quot;_embedded&quot;][&quot;estates&quot;]:
  
      insertRow = [&quot;{:&lt;30} {:&lt;30} {} {}&quot;.format(estate[&quot;name&quot;], estate[&quot;price&quot;], estate[&quot;locality&quot;])]
      sheet.insert_row(insertRow,2)
  
  insertRow = [&quot;sreality.cz&quot;, &quot;KONEC: &quot; + str(datetime.datetime.now().strftime('%d-%m-%Y ve %H:%M:%S'))]
  sheet2.insert_row(insertRow,2)
  time.sleep(60)
  </code></pre>
  <p>Error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;c:/Skola-Projekty/python/byt/sreality.cz.py&quot;, line 34, in &lt;module&gt;
      for estate in data[&quot;_embedded&quot;][&quot;estates&quot;]:
  TypeError: list indices must be integers or slices, not str
  PS C:\Skola-Projekty\python\byt&gt; 
  </code></pre>
  <p><strong>Edit2: Use help from @Andrej Kesely:</strong></p>
  <p>I use code, but it not split line into column. This code get all data into one line, then go to another line. I need them split into 3 column, is there way to do that with your code, please?</p>
  <p>OUTPUT in Google sheet:</p>
  <pre><code>Flat:                                                           Price Address
  Prodej bytu 1+kk 23 m²  2827000  Římská, Praha 2 - Vinohrady
  Prodej bytu 1+kk 27 m²  4049000  Ječná, Praha 2 - Nové Město
  Prodej bytu 1+kk 33 m²  6005000  Záhřebská, Praha 2 - Vinohrady
  </code></pre>
  <p>I need:</p>
  <pre><code>Flat:                           Price:             Address:
  Prodej bytu 1+kk 23 m²          2827000            Římská, Praha 2 - Vinohrady
  Prodej bytu 1+kk 27 m²          4049000            Ječná, Praha 2 - Nové Město
  Prodej bytu 1+kk 33 m²          6005000            Záhřebská, Praha 2 - Vinohrady
  </code></pre>