css-selectors

Can you use CSS selectors on SVG rendered via CSS Data URI?

好久不见. 提交于 2021-01-28 07:54:48
问题 I have some inline SVG with class names for styling via CSS selectors. I would like to bring the SVG into my CSS as a background-image data URI, but does this mean I can't use the CSS selectors anymore? I've read the existing StackOverflow responses, and the takeaway seems to be "You can't apply CSS because it's an image or resource from potentially another site". How do I change the colour of an SVG image in a CSS content property? Modify SVG fill color when being served as Background-Image

I need help finding an element with a locator

不想你离开。 提交于 2021-01-28 07:43:12
问题 I'm trying to get the elements from this xpath here is the code, there is several of these elements I cut the code down to avoid a million lines on here. html <keyword-text class="_nghost-fyp-81"><div class="keyword-text _ngcontent- fyp-81" clickabletooltiptarget="" aria-label=""><span class="keyword _ngcontent-fyp-81" aria-hidden="false">new york new york las vegas</span> <!----></div><!----><!----></keyword-text> xpath keyword_text = self.browser.find_elements_by_xpath("//span[starts-with(

Trying to select an option from the dropdown in Selenium web automation -error- “ElementNotInteractableException: could not be scrolled into view”

做~自己de王妃 提交于 2021-01-28 07:37:30
问题 package com.web.automation; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.Select; import org.openqa.selenium.support.ui.WebDriverWait; import org.testng.annotations.AfterMethod; import org.testng

Selenium not able to click on Get Data button on using Python

时光怂恿深爱的人放手 提交于 2021-01-28 06:22:37
问题 I am scraping data from this website . The element is below and geckodriver <img class="getdata-button" style="float:right;" src="/common/images/btn-get-data.gif" id="get" onclick="document.getElementById('submitMe').click()"> but can't get selenium to click it tried even xpath, id but not luck is there any fix or work around to get it done? 回答1: To click on the element Get Data you can use either of the following Locator Strategies: Using css_selector : driver.find_element_by_css_selector(

Set parent style via child [duplicate]

别说谁变了你拦得住时间么 提交于 2021-01-28 03:22:51
问题 This question already has answers here : Is there a CSS parent selector? (30 answers) Closed 2 years ago . Let's say I have the following <ul> : <ul> <li>Child</li> <li><span class="active">Child</span></li> <li>Child</li> </ul> Is it possible for me to change the style of the <li> via the active <span> ? E.g.: .active:parent(li) { background-color: red; } I've been able to achieve this with jQuery, but it flickers on the screen for a split second (waiting for the DOM to load) and I want to

Web scraping with selenium and python - xpath with contains text

こ雲淡風輕ζ 提交于 2021-01-28 02:00:22
问题 I will try to make it really short. I am trying to click on a product that came out of a search from a website. Basically there is a list of matching products, and I want to click on the first one which contains the product name I searched in its title. I will post the link of the website so you can inspect its DOM structure: https://www.tonercartuccestampanti.it/#/dfclassic/query=CE285A&query_name=match_and In this case, many contain my query string, and I would simply like to click on the

Multiple Pseudo Classes on a Single Selector

对着背影说爱祢 提交于 2021-01-27 18:49:51
问题 Is the following CSS syntax valid? a:first-child:hover { background-color: transparent; } If so, what is the compatibility as far as browsers? For example, is it compatible in IE8, IE6+, Firefox 4, Chrome, etc. 回答1: Combo first-child and :hover is correct(IE6 recognize only last pseudo-class in the chain): div span:first-child:hover { color: red; } <div> <span>asdasd</span> <span>asdasd</span> <span>asdasd</span> </div> 来源: https://stackoverflow.com/questions/27331619/multiple-pseudo-classes

Why is * given more specificity than property inheritance in CSS?

不想你离开。 提交于 2021-01-27 17:51:06
问题 Put simply, I have a page with these two styles: * { color: black; } div.error { color: red } And a page structure like: <html> ... <div class="error"> <div class="row form"> <div class="column"> Error text. </div> </div> </div> ... </html> You would expect "Error text" to be red, wouldn't you. But it is, in fact, rendered black in all browsers. Is this the expected behavior? My second question, is contingent on whether this is the expected behavior. if it is, then why would a designer ever

CSS outline width not working

早过忘川 提交于 2021-01-27 13:02:54
问题 I am trying to set outline width of the input element on focus. Outline width stays the same (like it is default setting which can not be changed), no matter of my setting. Here is example from code pen And here is part from css where I am trying to set outline-width on focus: input:focus { outline-width: 0.1px; outline-color: #725b44; } EDIT: I've just forgotten to include line style (solid, dotted...). Now it works. One thing is still strange to me. Why is outline inside element? Isnt' the

Jquery limit element query results [duplicate]

拟墨画扇 提交于 2021-01-27 02:57:07
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Selecting the first “n” items with jQuery I have an infinite countable list of elements! Is there a function to find x elements from the head of the list and stop! $('.elements').find('li').limit(10) //this does not work I tried the goog but i could not be specific enough with the ? ! 回答1: Yes, you can use jQuery's custom :lt selector for that. For instance, this will find only the first three li s in the given