title: How to count role attributes from html page in python
body: <p>is it possible to count how much time specific role shows up? There is a website and I want to use python to do this.</p>
  <p>e.g</p>
  <pre><code>&lt;div class=&quot;container&quot;&gt;
   &lt;div role=&quot;grid&quot;&gt;
    &lt;div role=&quot;gridcell&quot;&gt;&lt;/div&gt;
    &lt;div role=&quot;gridcell&quot;&gt;&lt;/div&gt;
    &lt;div role=&quot;gridcell&quot;&gt;&lt;/div&gt;
   &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>I want to count how much time &quot;gridcell&quot; shows up. I'm newbie so I don't know if this is possible if not can I just count how much &quot;divs&quot; are in <code>&lt;div role=&quot;grid&quot;&gt;</code></p>
  <p>I don't have much code to show just something basic</p>
  <pre><code>from selenium import webdriver
  from webdriver_manager.chrome import ChromeDriverManager
  import time
  import keyboard
  
  def show():
      if(keyboard.read_key() == &quot;c&quot;):
        #print(count_gridcell)
      
  browser = webdriver.Chrome(ChromeDriverManager().install())
  browser.get('https://www.example.com')
  
  time.sleep(5)
  show()
  </code></pre>