title: Extracting some text in a sentence from a website in python
body: <p>I was stuck while trying to extract some text in a sentence via this <a href="http://wiseafrican.isslserv.ng/index.php/category/nigerian-proverbs/yoruba-proverbs/page/5/" rel="nofollow noreferrer">website</a>.</p>
  
  <pre><code>import pandas as pd
  import requests
  from b24 import BeautifulSoap
  
  
  res = requests.get('http://wiseafrican.isslserv.ng/index.php/category/nigerian-proverbs/yoruba-proverbs/page/5/')
  soup4 = BeautifulSoup(res4.content, 'html.parser')
  
  soup4.findAll('div','excerpt')
  </code></pre>
  
  <p>Below are the output. I will like to extract only the sentence before <strong>Translation:</strong> in each html tag,before adding them to a <code>pandas DataFrame</code>.</p>
  
  <pre><code>
  [&lt;div class="excerpt"&gt;
   &lt;p&gt;A ki i fi ara eni se oogun alokunna. Translation: One does not use oneself as an ingredient in a medicine requiring that the ingredients be pulverized. Meaning; Self-preservation is a compulsory project for all.&lt;/p&gt;
   &lt;/div&gt;, &lt;div class="excerpt"&gt;
   &lt;p&gt;A ki i fi ai-mo-we mookun. Translation: One does not dive under water without knowing how to swim. Meaning: Never engage in a project for which you lack the requisite skills.&lt;/p&gt;
   &lt;/div&gt;, &lt;div class="excerpt"&gt;
   &lt;p&gt;A ki i fi agba sile sin agba. Translation: One does not leave one elder sitting to walk another elder part of his way. meaning: One should not slight one person in order to humor another.&lt;/p&gt;
   &lt;/div&gt;, &lt;div class="excerpt"&gt;
   &lt;p&gt;A ki i fa ori lehin olori. Translation: One does not shave a head in the absence of the owner. Meaning: One does not settle a matter in the absence of the person most concerned.&lt;/p&gt;
   &lt;/div&gt;, &lt;div class="excerpt"&gt;
   &lt;p&gt;A ki i duni loye ka fona ile-e Baale hanni. Translation: One does not compete with another for a chieftaincy title and also show the way to the king’s house to the competitor. Meaning: A person should be treated either as an adversary or as an ally, not as both.&lt;/p&gt;
   &lt;/div&gt;, &lt;div class="excerpt"&gt;
   &lt;p&gt;A ki i du ori olori ki awodi gbe teni lo. Translation: One does not fight to save another person’s head only to have a kite carry one’s own away. Meaning: One should not save other’s at the cost of one’s own safety.&lt;/p&gt;
   &lt;/div&gt;, &lt;div class="excerpt"&gt;
   &lt;p&gt;A ki i da eru ikun pa ori. Translation: One does not weigh the head down with a load that belongs to the belly. Meaning: Responsibilities should rest where they belong.&lt;/p&gt;
   &lt;/div&gt;, &lt;div class="excerpt"&gt;
   &lt;p&gt;A ki i da aro nisokun ala la nlo. Translation: One does not engage in a dyeing trade in (isokun) people there wear only white. Meaning Wherever one might be, one should respect the manners and habits of the place.&lt;/p&gt;
   &lt;/div&gt;, &lt;div class="excerpt"&gt;
   &lt;p&gt;A ki  bo sinu omi tan ka maa sa fun otutu. Translation: Does not enter into the water and then run from the cold. Meaning: Precautions are useful only before the event.&lt;/p&gt;
   &lt;/div&gt;, &lt;div class="excerpt"&gt;
   &lt;p&gt;A fun o lobe o tami si; o gbon ju olobe lo. Translation: You are given some stew and you add water; you must be wiser than the cook. Meaning: Adding water is a means of stretching stew. A person who thus stretches the stew he or she is given would seem to know better than the person who served it how much would suffice for the meal.&lt;/p&gt;
   &lt;/div&gt;]
  </code></pre>