title: How to extract text from svg using python selenium
body: <p>I'm trying to scrape the price from link: <a href="https://www.kbb.com/cadillac/deville/1996/sedan-4d/" rel="nofollow noreferrer">https://www.kbb.com/cadillac/deville/1996/sedan-4d/</a>
  <a href="https://i.stack.imgur.com/oZhmI.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oZhmI.jpg" alt="img showing price range"></a></p>
  
  <p>The prices are shown in <strong>text</strong> tag inside <strong>svg</strong> tag.</p>
  
  <p>When i use the xpath:
  <code>.//*[name()='svg']//*[name()='g']//*[name()='text']</code> inside the browser's inspect element, I'm able to find the tags. But the same xpath is not working in the code.</p>
  
  <p>The current code is:</p>
  
  <pre><code>def get_price(url):
      driver.get(url)
      time.sleep(10)
      try:
          price_xpaths = driver.find_elements_by_xpath(".//*[name()='svg']//*[name()='g']//*[name()='text']")
      except:
          print("price not found")
  
      for p in price_tags:
          print(p.text)
  </code></pre>
  
  <p>I get a blank list in return of function find_elements_by_xpath when I run the above code.
  I tried other things as well like switching to default content because the element is in <strong>#document</strong> </p>
  
  <pre><code>driver.switch_to_default_content()
  </code></pre>
  
  <p>but this also didn't work out well.
  If there is any other way to scrape price, please let me know.</p>