Choose the bubble rating from within the SVG element using Selenium

Hey there, I could use some assistance with retrieving the bubble rating from this website:

svg class="lazysvg-loaded" data-url="/fact-sheet/assets/icons/graphics/icons.htm" 
aria-hidden="true" focusable="false">  use xlink:href="#icon-gss-rating-45"></use></svg*

I've attempted a few methods:

rating = container[j].find_element_by_xpath(".//svg[contains(@class, 'lazysvg-loaded')]").get_attribute("class").split("_")[3]
rating = container[j].find_element_by_xpath(".//svg[contains(@class, 'icon-gss-rating-')]").get_attribute("class").split("_")[3]
rating = container[j].find_element_by_xpath(".//svg[contains(@href, 'icon-gss-rating-')]").get_attribute("class").split("_")[3]

However, I keep encountering this error:

NoSuchElementException:

Message: no such element: Unable to locate element: {"method":"xpath","selector":".//svg[contains(@class, 'icon-gss-rating-')]"}

If anyone can provide guidance on the correct approach, it would be greatly appreciated!

Thank you very much

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

I'm looking for a way to display a modal when a button is clicked and no record is selected from my table. My project is utilizing Bootstrap 4

<table id="resultTable" class="table table-hover table-bordered table-sm"> <thead> <tr> <th>Select</th> <th>Message Id</th> <th>Service</th> <th>Date</th> & ...

Struggling to successfully toggle the visibility of items

I am currently facing an issue with displaying different sets of data based on button clicks. The first block of information is showing correctly upon page load, but when I try to display other blocks by clicking on the corresponding buttons, the info cont ...

Converting an unordered list into a <select> dropdown with jquery - a step-by-step guide

Can you help me transform an unordered list that looks like this? <ul class="selectdropdown"> <li><a href="one.html" target="_blank">one</a></li> <li><a href="two.html" target="_blank">two</a></ ...

Expanding the size of select dropdown in Material UI to accommodate more options

Is there a way to increase the width of the drop down to 400px? I tried adding inline styles, but it didn't work. Upon debugging, I realized that the width is being overridden by this class. I'm not sure how to overwrite it. Could you please prov ...

Tips for saving input data from an HTML page to a text file

How can I save the inputs from a simple form as a text file using HTML code? Here is an example of the HTML code: <div id="wrapper"> <div class="main-content"> <div class="header"> </div> ...

Ways to align a div in relation to a span element?

I have a large block of text within a div. I am seeking a way to create a hover effect on specific words within the text, which will then display a div below the word containing a customized div. This functionality resembles the feature on Wikipedia where ...

Creating a dynamic drop down list in PHP populated from an SQL table with the added feature of displaying a default form value that changes based on user input

Currently, I am in the process of developing a form that allows users to modify demographic information about a member. One of the requirements is to include a dropdown list in an HTML form using PHP and also display a default value based on a specific ent ...

Designing a nested box layout with bootstrap HTML/CSS styling

Can anyone provide guidance on how to create a HTML/CSS layout similar to the image below? I am specifically struggling with designing the silver "Add corkscrew" box, a white box beneath it, and then another silver box nested within. Any suggestions on ho ...

Maximizing spacing for element alignment using space-evenly and :after

I have employed the pseudo-element :after to left-align the last line of a list of blocks, using space-evenly to justify these blocks. However, I am facing an issue where the blocks on the last line do not align properly with the others due to the space ta ...

What is the best way to ensure a sidebar's height matches the height of the content in a two-column table using div elements?

Just finished setting up a 2-column layout with a content div, sidebar div, header, and footer. You can check out the live example here. Any tips on how to make the sidebar's height match the content height (like a 2-column table)? Utilizing jquery ...

Position the div in the center, but for smaller sizes, switch to aligning

My current layout setup is as follows: Left side bar with a width of 200px and positioned at left: 0; Center section with a width of 700px and positioned at left: 250px; Right side bar with a width of 200px and positioned at right: 10px; While this arra ...

What is the process of linking a PHP file to an HTML form?

Having trouble sending emails with form data since the mailto function isn't working properly. For some reason, the php file is not connecting to the html form. When I try running index.html locally and hit submit, the browser displays php code inste ...

What is the best method for resetting a flexbox item?

I'm trying to achieve a layout with flex box where the first item spans 100% width, the second item is centered at 50% on its own line, and the third and fourth items each take up 50% width on the same line. Usually, clearing works fine on simple blo ...

What is the method for selecting an element using CSS code in Protractor?

Having trouble clicking on the element with CSS Selector: <button _ngcontent-c16="" class="btn btn-flat btn-no-text btn-kebab-view"> <i _ngcontent-c16="" class="zmdi zmdi-more-vert"></i> </button> This is what I've t ...

A variety of products combined into a single form

I am looking to enhance my form by allowing users to add multiple entries before submitting, similar to an "add to cart" feature. The added entries should be displayed on the same page in a separate div along with a submit button. Once the user is ready, t ...

Strategies for manipulating the position of an SVG polyline

Is there a way to move the chevron symbol to the beginning of each accordion header instead of it being on the right side of the words? Any help with this would be appreciated. The code snippet is provided below. Please advise on how to reposition the pol ...

Get rid of the border surrounding the JavaFX ScrollPane scroll bar when it is not in focus

I'm experiencing a quirky problem. I've customized the scroll-bar of my ScrollPane in JavaFX with CSS, but there's a strange behavior where the border disappears whenever the ScrollPane is in focus. However, if I interact with a button outsi ...

What specific component of the coding determines the appearance of the hover feature on the sub menu?

I am new to web development. I recently grabbed this code snippet from bootstrap.com and I'm trying to customize it. I've managed to change the color of the navigation menu by modifying the CSS, but I'm struggling to identify which part of t ...

JavaScript not functioning consistently on various browsers

When using http.responseText, it seems to not work properly in Chrome. Is there a way to modify this line so that it does? ...

How to rearrange rows sequentially within a table using Python Selenium

In this HTML setup Link to the HTML page: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title>Ea ...