title: Filter Div, BeautifulSoup, With Empty Return
body: <p>Running my algorithm below I seek to filter a <code>div</code>:</p>
  
  <pre><code>from bs4 import BeautifulSoup
  
  for link in soup.select('div &gt; a[href*="/tarefa"]'):
      ref=link.get('href')
      rt = ('https://brainly.com.br'+str(ref))
      p.append(rt)
  print(p)
  </code></pre>
  
  <p><code>Div</code> Below:</p>
  
  <pre><code>&lt;div class="sg-content-box__content"&gt;&lt;a href="/tarefa/2254726"&gt; 
  </code></pre>
  
  <p>adjust:</p>
  
  <pre><code>&lt;div class="sg-content-box"&gt;&lt;a href="/tarefa/21670613"&gt;
  </code></pre>
  
  <p>But in doing this the Return is empty.<strong>What could be the mistake in this part?</strong></p>
  
  <p>Expected Exit: Examples.</p>
  
  <pre><code>/tarefa/2254726 
  
  /tarefa/21670613  
  </code></pre>
  
  <p>How do I need to check it out? Sometimes the page would end up changing the content where href is a high amount of data, needed something like 'div> a [href * = "/ task"]' so you could search for it. keyword 'task' and not the creation of a variable already containing the content. </p>
  
  <p>Complete Algorithm: </p>
  
  <pre><code>from selenium import webdriver
  from bs4 import BeautifulSoup
  from selenium.webdriver.common.by import By
  from selenium.webdriver.support.ui import WebDriverWait
  from selenium.webdriver.support import expected_conditions as EC
  
  
  browser =webdriver.Firefox(executable_path=r'C:/path/geckodriver.exe')
  browser.get('https://brainly.com.br/app/ask?entry=hero&amp;q=jhyhv+vjh')
  
  html = browser.execute_script("return document.documentElement.outerHTML")
  p=[]
  soup=BeautifulSoup(html,'html.parser')
  for link in soup.select('div &gt; a[href*=""]'):
      ref=link.get('href')
      rt = ('https://brainly.com.br'+str(ref))
      p.append(rt)
  print(p)
  </code></pre>