title: How to extract value from html via BeautifulSoup
body: <p>I have parsed my string via BeautifulSoup.</p>
  <pre><code>from bs4 import BeautifulSoup
  import requests
  import re
  
  def otoMoto(link):
      URL = link
      page = requests.get(URL).content
  
      bs = BeautifulSoup(page, 'html.parser')
  
      for offer in bs.find_all('div', class_= &quot;offer-item__content ds-details-container&quot;):
  
          # print(offer)
          # print(&quot;znacznik&quot;)
          linkOtoMoto = offer.find('a', class_=&quot;offer-title__link&quot;).get('href')
          # title = offer.find(&quot;a&quot;)
          titleOtoMoto = offer.find('a', class_=&quot;offer-title__link&quot;).get('title')
          rokProdukcji = offer.find('li', class_=&quot;ds-param&quot;).get_text().strip()
          rokPrzebPojemPali = offer.find_all('li',class_=&quot;ds-param&quot;)
          print(linkOtoMoto+&quot; &quot;+titleOtoMoto+&quot; &quot;+rokProdukcji)
          print(rokPrzebPojemPali)
          break
  
  URL = &quot;https://www.otomoto.pl/osobowe/bmw/seria-3/od-2016/?search%5Bfilter_float_price%3Afrom%5D=50000&amp;search%5Bfilter_float_price%3Ato%5D=65000&amp;search%5Bfilter_float_year%3Ato%5D=2016&amp;search%5Bfilter_float_mileage%3Ato%5D=100000&amp;search%5Bfilter_enum_financial_option%5D=1&amp;search%5Border%5D=filter_float_price%3Adesc&amp;search%5Bbrand_program_id%5D%5B0%5D=&amp;search%5Bcountry%5D=&quot;
  
  otoMoto(URL)
  </code></pre>
  <p>Result:</p>
  <pre><code>https://www.otomoto.pl/oferta/bmw-seria-3-x-drive-nowe-opony-ID6Dr4JE.html#d51bf88c70 BMW Seria 3 2016
  [&lt;li class=&quot;ds-param&quot; data-code=&quot;year&quot;&gt;
  &lt;span&gt;2016 &lt;/span&gt;
  &lt;/li&gt;, &lt;li class=&quot;ds-param&quot; data-code=&quot;mileage&quot;&gt;
  &lt;span&gt;50 000 km&lt;/span&gt;
  &lt;/li&gt;, &lt;li class=&quot;ds-param&quot; data-code=&quot;engine_capacity&quot;&gt;
  &lt;span&gt;1 998 cm3&lt;/span&gt;
  &lt;/li&gt;, &lt;li class=&quot;ds-param&quot; data-code=&quot;fuel_type&quot;&gt;
  &lt;span&gt;Benzyna&lt;/span&gt;
  &lt;/li&gt;]
  </code></pre>
  <p>So I can extract single strings, but if I see this same class</p>
  <pre><code>class=&quot;ds-param&quot;
  </code></pre>
  <p>I can't assigne, for example, production date to variable. Please let me know if you have any ideas :).</p>
  <p>Have a nice day !</p>