title: Python selenium scrape - particular informations from block of code
body: <p>I need scrape (and collect) some live sport stats from local betting <a href="https://www.nike.sk/live/prehlad" rel="nofollow noreferrer">site</a>. Im using python for that. So, how can I add to python dataframe actual state? In my code I have a variable &quot;games_container &quot;, but I dont know how extract particular informations (sport, league, team A, team B, result...). Thanks for any help.</p>
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  from datetime import datetime
  import time
  import requests
  from time import gmtime, strftime, localtime
  from selenium import webdriver
  from selenium.webdriver.chrome.options import Options
  import re
  from bs4 import BeautifulSoup
  import pandas as pd
  import numbers
  import matplotlib
  
  from selenium.webdriver import ActionChains
  
  DRIVER_PATH = 'C:\\executables\\chromedriver.exe'
  
  options = Options()
  options.headless = True
  options.add_argument(&quot;--window-size=1920,1200&quot;)
  
  driver = webdriver.Chrome(options=options, executable_path=DRIVER_PATH)
  
  driver.get(&quot;https://www.nike.sk/live/prehlad&quot;)
  
  time.sleep(20)
  
  
  games_container = soup.find_all(class_='sport-content-div sport-content clearfix')
  </code></pre>
  <p>Expectet output (shape of pandas dataframe):</p>
  <p><a href="https://i.stack.imgur.com/lPkOC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lPkOC.png" alt="Expected output" /></a></p>
  <p>.................................
  EDIT:
  Is possible make for loop who extract from this part of code: &quot;home shorten label 1&quot;, &quot;game result&quot; and &quot;home shorten label 2&quot;?</p>
  <p><a href="https://i.stack.imgur.com/wxsUh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wxsUh.png" alt="Site code" /></a></p>
  <p>................................. EDIT_2:
  When I use:</p>
  <pre><code>driver.get(&quot;https://www.nike.sk/live/prehlad&quot;)
  time.sleep(15)
  
  soup = BeautifulSoup(driver.page_source,'html5lib')
  games = soup.find_all('div',{'data-atid':'live-sport-box'})
  
  for game in games:
      print(game.find('h2').getText())
      labels = game.find('h4',{'class':'game-content-title'}).findChildren('span',recursive=False)
      label1 = labels[0].getText()
      label2 = labels[2].getText()
      result = labels[1].getText()
      print(f&quot;{label1} : {label2} : {result}&quot;)
  </code></pre>
  <p>In my output is only 1 match (1 row) for each sport:</p>
  <pre><code>Tenis  (21)Podľa turnaja/súťažePodľa času
   Cristian J.A. : Krunic A.  : 0 - 0
  Futbal  (4)Podľa turnaja/súťažePodľa času
   Shaanxi Changan : Chengdu Rongcheng  : 0 - 0
  Hokej  (4)Podľa turnaja/súťažePodľa času
   MHC Torpedo : MHC Arlan  : 4 - 1
  </code></pre>
  <p>How can I print (iterate) all matches for all sports?</p>