Use Stack Overflow for Teams at work to find answers in a private and secure environment. Get your first 10 users free. .

Questions tagged [css-selectors]

Selectors are patterns that match against elements in a document tree. In a CSS rule, they are used to define styles for elements that match the pattern.

Filter by
Sorted by
Tagged with
0
votes
0answers
31 views

CSS unexpected behaviour when using ~ (tilde) with comma

I'm trying to build an input field that has a dropdown of possible options, but that dropdown should only be showing when the input is in the 'active' state (:active). Here's an example of how this ...
0
votes
2answers
40 views

Download file from website with selenium on Python 2.7.5. File changes part of a name daily (date is part of file's name)

I have following problem. I am trying to script downloading file, which is being daily uploaded on a website. file name is "My Report $date.xlsx" (so Today it's "My Report 20190917.xlsx). The only ...
-1
votes
2answers
39 views

how to have body background image only on landing page

I've created a second page of my website and my first page is simply a landing page with the background image. However, when i go onto the second page I created, the background image i use on my ...
0
votes
1answer
11 views

How to activate parent animation on focus (tab over to) child

While trying to describe it, I think it would be easiest to simply show the code. <div class="cdm-animated-card"> <div class="cardTitle"> <h5 class="cardHeader">...
-1
votes
0answers
26 views

Chrome Devtools how to copy this CSS Selector

I understand that there is Copy CSS path and Copy selector, but the result is different and you have to change it manually. It seems logical that there should be some kind of hotkey or button for this....
1
vote
1answer
38 views

Selenium finds the element (anchor) but still says element not visible?

I have a "clear all" button which is an anchor. The HTML structure is like this: <div class="form-row toggle-closed" id="ProductFilters" style="display: block;"> <div class="form-...
1
vote
2answers
41 views

How to submit data on web form if button has only type and value using Python

I have the following URL from which I want to pass some product number and get the current URL https://www.skroutz.gr/ the form has <form method="get" action="/search" accept-charset="utf-8"> ...
0
votes
1answer
22 views

Does Squarespace not allow for class and id selectors to be used in custom HTML and then targeted in the CSS editor?

Hello StackOverflow Community, I just started using Squarespace to create a site for a client & friend offering some safety and equipment training courses, I love the templates, it's quite easy ...
1
vote
1answer
36 views

I need help finding an element with a locator

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"&...
-3
votes
1answer
26 views

How do I click the Home, Trending, and Subscriptions buttons on YouTube with Selenium?

Beginner here. I'm trying to grab the CSS Selectors for these buttons on youtube, and click them with Selenium. All three share the same Selectors, so not sure what I'm missing here.
0
votes
1answer
40 views

CSS use of :not() selector on an inner table

I am using AjaxControlToolkit and the main-page CSS is also affecting the inner "calendar" popup. I've reduced everything to a simple 1-page example showing what I want, what I've tried, and the "...
1
vote
1answer
42 views

Why does Selenium appends a back slash to the dot (.) character resulting into (\.) for the value of ID attribute that has a (.) in it

I want to get an element by ID with selenium in JAVA. The ID of the element in question so happens to have a period in it id="myprojectId0.123456789" when I try to find the element like so ...
1
vote
2answers
38 views

page.$eval function in puppeteer always returning undefined

I'm using puppeteer and the function page.$(selector) to get the value. The function returns the error "Expected to get |string| or |function| as the first argument, but got "undefined" instead." I ...
0
votes
1answer
38 views

How to swich to a frame and access element in it?

I wanted to access the element with text as Deprecated within "http://demo.guru99.com/selenium/deprecated.html" link in selenium in chrome browser WebDriverWait wait = new WebDriverWait(driver, 10); ...
3
votes
2answers
49 views

Remove all elements from website except X

I'm not really familiar with Javascript, and even less with how Javascript works in Chrome's F12 developer tools. What I'm trying to do is have a favorite which, when clicked on, loads a web page but ...
3
votes
1answer
42 views

Target each instance of a class on the page for custom background color using CSS only

I have the same code repeated 3 times on my page, I need to target the ImageSection-hold class and have a different background color for each one. I am not able to add or remove any classes via HTML ...
0
votes
2answers
65 views

How to locate this element?

I want to locate the "NEXT" button. Locating by class name is not working because there is other element with the same class name. This button has no ID. I tried locating by xpath>>contains text etc ...
0
votes
2answers
38 views

Aligning a content in center within a class using CSS?

Hello fellow developers community. Im pretty new to using CSS, currently when I increase the width of my class .form-search to i.e. 105% in my CSS, then this moves the search bar to the right, I want ...
0
votes
1answer
18 views

lxml cssselect - specific part

I need to get the Translations section of a web page. This is my python code: import urllib.request u = urllib.request.urlopen("https://docs.python-guide.org/writing/structure/#structure-of-the-...
0
votes
1answer
38 views

Is there a way to include elements from html inside a class in Ruby?

I am working on a web scraping problem. I selected elements from HTML using css-selectors and I was wondering if it is possible to include them inside a class in Ruby name = browser.p(css: 'p[bo-bind=...
1
vote
2answers
29 views

Combination :before and :first-letter is not working when adding display:flex

For some reason the :first-letter pseudo element in combination with the :before pseudo element is not working when you add dislay: flex;. This should work, on mozilla they say: A combination of ...
1
vote
0answers
23 views

How do I set a value to its default user agent value?

By using the initial value, I can set an element's CSS property to its initial value as defined by the specification. But in some cases, I want to set a CSS property to its initial user agent value ...
0
votes
1answer
33 views

How to change ::after of child element

I have a parent and some child elements but I can't change their CSS directly. So, I'm trying to change my child's CSS inside the css of my parent element. Example: .parent { & .child { ...
0
votes
2answers
47 views

Why isn't .class element {} overriding element {}?

I want to override styles I tried different code. I delete cache and stopped creating static CSS files delivered from CDN. .page-special article { background: none; padding-bottom: 0; } ....
1
vote
1answer
41 views

selenium two xpath tests in one

I try to combine check for two scenarios: If startupcheck fails we get a try again button: el = WebDriverWait(self.driver, 10).until( EC.element_to_be_clickable((By.NAME, "Try again"))) Or ...
1
vote
1answer
50 views

How to get text of an element on the basis of other element's text value on the same row in the table?

I need to find the text of an element "score" on the basis of other element "SF Lead ID" on the same row. "SF Lead ID" can be dynamic. for example am using hard coded value here. String sf_id = "...
-3
votes
0answers
38 views

How to manipulate this pictures to look like the file?

I have a question about one file. How to modify these pictures to look like the file. And looking to the right there is a form. I need your help. Link for file: https://xd.adobe.com/spec/260e1859-...
0
votes
2answers
35 views

Unable to retrieve the table body contents using Selenium

Trying to get the contents of body in table id = mytable by putting value in registration no. But failed to get. Tried using headers like user agents and beautifulsoup network tab form data, but ...
0
votes
2answers
41 views

Can't locate element by id

I am doing this: WebElement userName = driver.findElement(By.id("username")); but I get: Unable to locate element: #username My DOM looks like this: <input type="text" name="username" id="...
1
vote
2answers
51 views

Access html text through python selenium

I am trying to get text (marked by hashtags). <div class="XYZ"> <h5> " #######Reports due by############## " <span class="hbl" data-hint="task due ...
1
vote
1answer
31 views

Extracting texts from <li> items with selenium in Python

I´m trying to get the text inside a /a tag in a nested ul-li structure. I locate all the "li", but can´t get the text inside a's. I´m using Python 3.7 and Selenium webdriver with Firefox driver. The ...
0
votes
2answers
41 views

Python Selenium Webdriver get text inside “data-original-title”

I have a question about selenium webdriver. Everything is working fine but there is one element I don't get to work. That's the html tag when i inspect the element: <img src="https://s3....
0
votes
1answer
32 views

How to click on the button with text as Get the App within the website https://www.wikiloc.com/wikiloc/download.do?id=41057284

I want to press the green download button from this website: https://www.wikiloc.com/wikiloc/download.do?id=41057284 using selenium chrome driver. However nothing works. I tried searching by xpath: ...
0
votes
2answers
44 views

How to click hidden buttons in Python Selenium?

I'm working on simple automation in Selenium. I need to click a specific button. I can't because it is hidden in div/table without class. I'm attaching a screenshot of the html. I did try xpath, css ...
-1
votes
1answer
54 views

Why don't we use the star in css resets(eric meyer reset) [closed]

I'm learning about CSS resets and I'm curious about why they don't use the star in the CSS reset since they write down every element individually in the reset
0
votes
0answers
25 views

Import hashed CSS className and select it in another file

I am using webpack to hash my css class names and for example I have: checkbox.scss input { .inner { // code } .checked { // code } } and I want to import this file ...
0
votes
1answer
19 views

how to find the position of an element in the sequence through selenium java

In the image, I want to find the position of the "ContentHotspot" is six in the div class of "MainLoader" Is there a way through css selector , xpath etc to find out the position is six. Rest all ...
-1
votes
1answer
33 views

How to write code for linkText for the html code

I am new to selenium and trying to write linktext code for the html code <a href="repopulateUser.jsp?authAuthSessionId=7DD74346650647B7BA9ED08C1ABAE66D&amp;roleId=bc95f1f2-9ccd-11e8-9a37-...
-1
votes
1answer
81 views

How to write deepCss for input Textbox in protractor?

I am trying to sendKeys in input textbox in protractor. It's in a shadow-root and there are three input textbox.
2
votes
2answers
62 views

Extract the breadcrumbs of a website using selenium

i need to extract the breadcrumbs of this website site: https://www.woolworths.com.au/Shop/Browse/drinks/cordials-juices-iced-teas/iced-teas I tried to inspect the element and copy the xpath but it ...
-3
votes
0answers
58 views

How to style the overlay-play-button in videogular

I am trying to change the css style of videogular button. I have tried using the following selector in the css file, but with no result. //i chose a random icon for the example videogular vg-...
2
votes
1answer
33 views

How to properly cycle through nth-of-type? [duplicate]

I realize that there's a tonne of information about this online and on this forum. I've read through a bunch of it and tried several different approaches, but for some reason I can't wrap my head ...
0
votes
1answer
60 views

scrapy with cssselct

I am trying to make an exercise using cssselect unfortunately just works when I read the <h1> let me show you the example: the HTML code that I am using for this exercise is the follow: <...
-3
votes
2answers
48 views

How do I cycle through these elements using selenium in python and get the XPATH value in return?

I want to be able to cycle through this table's tabs and return the XPATHs and tab names. I am using the python selenium webdriver. This is the main container containing all the tabs from which i ...
1
vote
1answer
32 views

How to ignore, or discard overlayed dialog box on website?

I try to parse this site with chromedriver But there's a dialog box that messes up with that Is there a way to discard the dialog box or choose the No, thanks button?
0
votes
0answers
15 views

How to locate an SVG element in selenium webdriver [duplicate]

I have a webelement (drop down arrow) which happens to be a SVG element. while trying to locate and click on the drop down arrow, driver ends in no such element found exception. Xpath used: '//[...
-1
votes
2answers
31 views

selenium.common.exceptions.NoSuchElementException: Message: no such element error in Python selenium even though ID and name are present in HTML

I have tried to select radio button in selenium python using by_id, by_name but getting error message as: selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate ...
-4
votes
1answer
43 views

Is it possible to use CSS nth-child to follow this pattern? [duplicate]

Here is what I'm currently using to select certain items... .col { &:nth-child(21), &:nth-child(22), &:nth-child(43), ...
0
votes
1answer
59 views

What's the shortest way to use CSS multiple combinators?

I want to style all the input and select from inside a certain div in a certain manner. I know I can do (1) #divNew select { display:table-cell; margin-left:1em; } #divNew input { display:...
-1
votes
2answers
65 views

How can I remove the right margin of the last <i>?

I tried :last-child {margin-right: 0;} but it didn't work. .navigation-menu .social-icons i { margin-top: 15px; margin-right: 10px; color: #FFFFFF; } <link href="https://cdnjs....