title: Print all elements in <li> - BeautifulSoup
body: <p>I am web-scraping with <code>Python</code> and <code>BeautifulSoup</code>.</p>
  
  <p>I need to scrape this</p>
  
  <pre><code>&lt;li class="review-rating"&gt;
     &lt;h5 class="review-rating__title"&gt;Location:&lt;/h5&gt;
     &lt;span class="review-rating__score"&gt;5&lt;/span&gt;
     &lt;h5 class="review-rating__title"&gt;Value:&lt;/h5&gt;
     &lt;span class="review-rating__score"&gt;3&lt;/span&gt;
     &lt;h5 class="review-rating__title"&gt;Facilities:&lt;/h5&gt;
     &lt;span class="review-rating__score"&gt;4&lt;/span&gt;
     &lt;h5 class="review-rating__title"&gt;Service:&lt;/h5&gt;
     &lt;span class="review-rating__score"&gt;4&lt;/span&gt;
     &lt;h5 class="review-rating__title"&gt;Cleanliness:&lt;/h5&gt;
     &lt;span class="review-rating__score"&gt;5&lt;/span&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>I have actually scraped this markup with this code</p>
  
  <pre><code>for scores_of_this_customer in tt.select('li.review-rating'):
     print(scores_of_this_customer.select('h5.review-rating__title')[0].text +" "+scores_of_this_customer.select('span.review-rating__score')[0].text)
  </code></pre>
  
  <p>But this prints only <code>Location: 5</code></p>
  
  <p>I want a way to print all those scores by using a Loop.</p>
  
  <p>I know I can print other Scores by indexing them as <code>[1]</code>,<code>[2]</code>... and so on but I don't want to write 5 print statements</p>
  
  <p><strong>PS:</strong></p>
  
  <p>This code worked for me.</p>
  
  <pre><code>if tt.select('li.review-rating'):
        soup = tt.select('li.review-rating').find("li", {"class", "review-rating"})
        keys = soup.findAll("h5", {"class" : "review-rating__title"})
        values = soup.findAll("span", {"class" : "review-rating__score"})
        for key, value in zip(keys, values):
         print(key.text + ": " + value.text)
  </code></pre>