title: Getting individual data from a <li> as text using BeautifulSoup Python
body: <p>This is a section of the HTML file i want to get data from.</p>
  
  <pre><code>&lt;ul class="listing-key-specs "&gt;
     &lt;li&gt;2002 (02 reg)&lt;/li&gt;
     &lt;li&gt;Hatchback&lt;/li&gt;
     &lt;li&gt;115,000 miles&lt;/li&gt;
     &lt;li&gt;Manual&lt;/li&gt;
     &lt;li&gt;1.8L&lt;/li&gt;
     &lt;li&gt;123 bhp&lt;/li&gt;
     &lt;li&gt;Petrol&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>This is how i extracted the <code>&lt;ul&gt;</code> from the rest of the document</p>
  
  <pre><code>soup = BeautifulSoup(page.content, 'html.parser')
  vehicle_details = soup.find_all('ul', class_='listing-key-specs')
  split_details = vehicle_details[2].get_text()
  print (split_details)
  </code></pre>
  
  <p>From this line of code i get this output</p>
  
  <pre><code> 2002 (02 reg)
   Hatchback
   115,000 miles
   Manual
   1.8L
   123 bhp
   Petrol
  </code></pre>
  
  <p>However, what I want to do is to get each line from the output and put into a a list, so that the first line will be the first index and so on. But when I split the output by line break i get this output</p>
  
  <pre><code> split_details = split_details.split('\n')
   ['', '2002 (02 reg)', 'Hatchback', '115,000 miles', 'Manual', '1.8L', '123 bhp', 'Petrol', '']
  </code></pre>
  
  <p>Which isn't what I want. Is there something I'm missing or is there another way to split this string into lines?</p>
  
  <p><a href="https://www.autotrader.co.uk/car-search?advertising-location=at_cars&amp;search-target=usedcars&amp;is-quick-search=true&amp;radius=&amp;onesearchad=used&amp;onesearchad=nearlynew&amp;onesearchad=new&amp;make=&amp;price-search-type=total-price&amp;price-from=&amp;price-to=&amp;postcode=e14ns" rel="nofollow noreferrer">This is the website</a> if you're curious.</p>