title: Python/BeautifulSoup - how to assign html code to variable
body: <p>How i can assign html code to a variable so later I could refer to it?</p>
  <p>Example:</p>
  <pre><code>&quot;div class='test'&quot; - some html code
  
  
  
  some_variable = &quot;'div', {'class': ='test'}&quot; *#assigning above to the variable*
  
  print(soup.find(some_variable)) *# is not working*
  print(soup.find('div', {&quot;class&quot;: 'test'}) # **is working**
  </code></pre>