title: Python Beautiful Soup 4 Scraping IPL League Table from Cricinfo
body: <p>I am learning how to scrape websites using the module Beautiful Soup 4. I am trying to scrape a cricket league table and so far have used the following code.</p>
  <pre><code>#We want to scrape the cricinfo website for the league table
  import requests
  from bs4 import BeautifulSoup as bs
  
  r = requests.get(&quot;https://www.espncricinfo.com/table/series/8048/season/2020/indian-premier-league&quot;)
  soup = bs(r.content)
  headers = soup.find_all('h5')
  print(headers)
  </code></pre>
  <p>This is the output I get once I run the code</p>
  <pre><code>[&lt;h5 class=&quot;header-title label &quot;&gt;Indian Premier League 2020&lt;/h5&gt;,
   &lt;h5 class=&quot;header-title label &quot;&gt;Mumbai Indians&lt;/h5&gt;,
   &lt;h5 class=&quot;header-title label &quot;&gt;Royal Challengers Bangalore&lt;/h5&gt;,
   &lt;h5 class=&quot;header-title label &quot;&gt;Delhi Capitals&lt;/h5&gt;,
   &lt;h5 class=&quot;header-title label &quot;&gt;Sunrisers Hyderabad&lt;/h5&gt;,
   &lt;h5 class=&quot;header-title label &quot;&gt;Kings XI Punjab&lt;/h5&gt;,
   &lt;h5 class=&quot;header-title label &quot;&gt;Rajasthan Royals&lt;/h5&gt;,
   &lt;h5 class=&quot;header-title label &quot;&gt;Kolkata Knight Riders&lt;/h5&gt;,
   &lt;h5 class=&quot;header-title label &quot;&gt;Chennai Super Kings&lt;/h5&gt;,
   &lt;h5 class=&quot;gray600&quot;&gt;Standings are updated with the completion of each game&lt;/h5&gt;]
  </code></pre>
  <p>What I would like to do now is to scrape this even further and get a list containing the team names and get rid of the top and bottom line</p>
  <p>E.g. I would like the final list to be something like</p>
  <pre><code>teams = ['Mumbai Indians', 'Royal Challengers Bangalore', 'Delhi Capitals', 'Sunrisers Hyderabad'. 'Kings XI Punjab', 'Rajasthan Royals', 'Kolkata Knight Riders', 'Chennai Super Kings']
  </code></pre>
  <p>Any help would be greatly appreciated
  Thank You</p>