css-selectors

How to retrieve the text of a WebElement using Selenium - Python

会有一股神秘感。 提交于 2021-01-29 21:25:36
问题 I am new to Python and Web Scraping so please bear with me. I have been trying to build a web scraping tool to open a web page, log-in, and retrieve a certain value. Thus far, I have been able to open the web page and log-in. However, I simply cannot find a way to retrieve (print) the value that I require. This is what my current code looks like: from selenium import webdriver from bs4 import BeautifulSoup driver = webdriver.Chrome(executable_path=r'C:/Users/User/Downloads/chromedriver.exe')

how to overwrite `display: none` for checkbox?

£可爱£侵袭症+ 提交于 2021-01-29 20:41:04
问题 Currently at this web page there is a table It looks like the default template of the web got in CSS input[type="checkbox"], input[type="radio"] { display: none; } Now the checkboxes are not visible - see But if I uncheck the display: none then the checkboxes are visible. Is there any way I can make them visible in html using style when creating the checkbox? I do not have the permission to edit css. I can add custom css though. 回答1: Most likely these should be inline-blocks when visible (i.e

CSS direct descendent selectors

人走茶凉 提交于 2021-01-29 18:21:00
问题 I'm having a little trouble and I'm sure there's a simple fix for this seemly trvial question. I have my HTML page setup with like the follow: <ul class="locations"> <li> Georgia <ul class="children"> <li> Fulton County <ul class="children"> <li> Atlanta </li> </ul> </li> </ul> </li> </ul> I'm trying to style the "parents" list items one way, the "children" one way, and the "grandchildren" another way. I've tried the following: ul li{ list-style: none; margin: 0; } ul.locations li+ul.children

How to click the Continue button within a website using selenium in python?

萝らか妹 提交于 2021-01-29 17:23:57
问题 I am trying to write a code that is able to auto apply on job openings on indeed.com. I have managed to reach the last stage, however, the final 2 clicks on the application form is giving me a lot of trouble. Please refer to the first page as below Once we click on continue on the first page, for the second page I first need to scroll down a bit to reach from here... ..to here and then finally click on apply. I am stuck on the first page, as the click function does not do anything. I have

Click on ember.js enabled element using Selenium

℡╲_俬逩灬. 提交于 2021-01-29 12:46:34
问题 I am trying to click on the following button on a linkedin page using selenium : <button id="ember607" class="share-actions__primary-action artdeco-button artdeco-button--2 artdeco-button--primary ember-view" data-control-name="share.post"><!----> <span class="artdeco-button__text"> Post </span></button> I have tried to use: driver.find_element_by_id , but the id of the button seems to keep changing number driver.find_element_by_xpath , but this contains the button number, so also fails

How to extract all <li> elements under <ul>

大兔子大兔子 提交于 2021-01-29 12:29:15
问题 I want to extract all <li> element text that are under <ul> for which I tried elem = driver.find_elements_by_xpath(("//div[@class='left width50']/p/b/ul")) len(elem) gives '0' or empty list. here is the html source <div class="left width50"> <p><b>Features:</b></p> <ul> <li>Easy spray application</li> <li>Excellent bonding properties</li> <li>Single package</li> <li>Mixed with clean potable water at job site</li> </ul> </div> HERE is the link of the website How to go about it any suggestions?

Python Selenium Internet explorer not able to find css selector, or xpath

喜你入骨 提交于 2021-01-29 12:00:34
问题 So a little background on this, flask is being run through alwaysup, which keeps flask always up as a windows service. This whole process makes my selenium script start in a different instance not in the local VM. When it's running in that instance, it has the same internet settings and it navigates to the url without any problem. It gets stuck once it needs to start filling out the form, for example. driver.find_element_by_id('ctl00_PlaceHolderMain_CreatePerson_uoc_BasicInfo_grouping

How do I click on active day on date picker using selenium python?

醉酒当歌 提交于 2021-01-29 10:54:54
问题 So there are multiple calendars (datepickers) on the page and I have managed to click on the desired calendar. I want to click on the active date (current date). class="day active" How can I find this element after clicking on desired calendar glyphicon? P.S. when I copy selector for this- I am getting body > div:nth-child(27) > div.datepicker-days > table > tbody > tr:nth-child(4) > td.day.active And when I inspect element and search td.day.active, I am able to reach that element. So I have

How to chain cy.get in cypress

China☆狼群 提交于 2021-01-29 08:12:40
问题 I'm trying to get to #1 element then get to #2 element to click on #3 element . but I'm having a trouble with getting the correct CSS selector in Cypress. How to write a test script for this? I've tried cy.get('.ui.active.visible.button.floating.dropdown.fr-dropdown').contains('Delete yield').click() but doesn't work. Is there a way to get #1 first, then #2 to reach #3? this is not a real code but something like this. cy.get('.yield-event__date-and-text--container').contains('10kg') cy.get('

UnexpectedTagNameException: Message: Select only works on <select> elements, not on <li>error selecting li element from a Dropdown using Selenium

狂风中的少年 提交于 2021-01-29 04:49:59
问题 I wish to click on New Test. The HTML code looks something like this. I'm new here and beginning to learn automation using selenium-python. <li id="testing"> <ul class="dd"> <li><a href="javascript:toolsPopup('/abc/xyz/text.html');"><span>New Test</span></a></li> <li><a href="javascript:toolsPopup('/abc/xyz/list.html');"><span>Test List</span></a></li> </ul> </li> The code that I'm trying to use element=driver.find_element_by_id('testing') drp=Select(element) drp.select_by_visible_text('New