title: create a finder function with BeautifoulSoup
body: <p>I have a <code>def</code> for web-scraping but when I put an attribute in a variable, (list) <code>beautifulsoup</code> doesn't resolve it, if i execute it returns <code>none</code> but if I put it by hand it works.</p>
  <pre><code># llibreria x fer peticions html
  import requests
  #importem el Soup per fer busquedes al web
  from bs4 import BeautifulSoup
  
  #funcio x buscar a la web i fer codi reutilizable n
  def finder(url):
      headers = {&quot;User-Agent&quot;: &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36&quot;}
      page = requests.get(url[0], headers=headers)
      soup = BeautifulSoup(page.content, &quot;html.parser&quot;)
      result = soup.find(url[1])
      price = soup.find(url[2])
      price = price.replace(&quot;€&quot;,&quot;&quot;)
      price = price.replace(&quot;.&quot;,&quot;&quot;)
      price = int(price)
      print(&quot;__________ House Finded _________&quot;)
      print(result.text)
      print(price)
      print(&quot;________________________________&quot;)
      
      
  habitaclia =[ &quot;https://www.habitaclia.com/comprar-casa_pareada-en_venta_en_llanca_el_colomer_la_bateria_la_coma-llansa-i16454000001818.htm?hab=3&amp;ordenar=precio_mas_bajo&amp;st=3,6,8,10,12,15&amp;f=parking&amp;geo=p&amp;from=list&amp;lo=55&quot;, &quot;h1&quot;, &quot;'span', {'itemprop':'price'&quot;]
  finder(habitaclia)  
  </code></pre>