title: How to test CSS values in Python using selenium?
body: <p>I'm trying to test the video dimensions using the values in CSS as shown in the image below.</p>
  <p><a href="https://i.stack.imgur.com/5DBjZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5DBjZ.png" alt="html" /></a></p>
  <p>The CSS is being used by the Div below. The below is what I've done so far and the error I get.</p>
  <pre><code>def test_video_dimensions(browser):
  
  browser.get(url_for(&quot;main.index&quot;, _external=True) + &quot;video/title1/?video-height=500&amp;video-width=750&quot;)
  
  rows = browser.find_elements(
      By.XPATH, &quot;/html/head/style[2]&quot;
  )
  assert (
      rows[0].find_element(By.XPATH, &quot;/html/head/style[2]&quot;).text
      == &quot;CSS Value&quot;
  )
  </code></pre>
  <p><a href="https://i.stack.imgur.com/f89Tr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f89Tr.png" alt="enter image description here" /></a></p>
  <p>Any help to access the inside of the CSS style tag and compare the values in it?</p>