css-selectors

Automating jQuery based bootstrap dropdown using Selenium and Java

徘徊边缘 提交于 2021-02-02 09:37:07
问题 I am trying to list all elements from the bootstrap dropdown and then select a certain value. However, it returns 0 values. Any suggestions will be greatly appreciated. driver.findElement(By.id("imgSelectButton")).click(); Thread.sleep(3000); List<WebElement> list = driver.findElements(By.xpath("//ul/li[@class='logoSelectOpt']//li")); System.out.println(list.size()); for(int i=0; i<list.size(); i++){ System.out.println(list.get(i).getText()); if (list.get(i).getText().contains("History")){

Automating jQuery based bootstrap dropdown using Selenium and Java

大兔子大兔子 提交于 2021-02-02 09:36:04
问题 I am trying to list all elements from the bootstrap dropdown and then select a certain value. However, it returns 0 values. Any suggestions will be greatly appreciated. driver.findElement(By.id("imgSelectButton")).click(); Thread.sleep(3000); List<WebElement> list = driver.findElements(By.xpath("//ul/li[@class='logoSelectOpt']//li")); System.out.println(list.size()); for(int i=0; i<list.size(); i++){ System.out.println(list.get(i).getText()); if (list.get(i).getText().contains("History")){

Unable to locate element using selenium chrome webdriver in python selenium

China☆狼群 提交于 2021-02-02 09:32:37
问题 I am new to python and trying to do some webscraping but have some real issues. May be you can help me out. HTML: <input autocomplete="off" type="search" name="search-search-field" placeholder="150k companies worldwide" data-cy-id="search-search-field" class="sc-dnqmqq grpFhe" value=""> The first part of my code looks as follows and works good without having any issues: driver.get("https:") login = driver.find_element_by_xpath(email_xpath).send_keys(email) login = driver.find_element_by_xpath

Element not Interactable when using the selenium function find element by name but works when using find element by xpath method

*爱你&永不变心* 提交于 2021-02-01 05:14:57
问题 I have webpage where I am trying to login to it. When I use find element by name method to find the elements I get element not interactable error but when i use find element by xpath it works fine and no error. Can anyone explain me why it is not able to interact with element when found by name method? Same issue is observed for User ID, Password and Login elements. I am sure even when using by name method website is loaded and is ready for use. Below is the screenshot of the Webpage login My

Element not Interactable when using the selenium function find element by name but works when using find element by xpath method

杀马特。学长 韩版系。学妹 提交于 2021-02-01 05:14:46
问题 I have webpage where I am trying to login to it. When I use find element by name method to find the elements I get element not interactable error but when i use find element by xpath it works fine and no error. Can anyone explain me why it is not able to interact with element when found by name method? Same issue is observed for User ID, Password and Login elements. I am sure even when using by name method website is loaded and is ready for use. Below is the screenshot of the Webpage login My

Element not Interactable when using the selenium function find element by name but works when using find element by xpath method

限于喜欢 提交于 2021-02-01 05:14:18
问题 I have webpage where I am trying to login to it. When I use find element by name method to find the elements I get element not interactable error but when i use find element by xpath it works fine and no error. Can anyone explain me why it is not able to interact with element when found by name method? Same issue is observed for User ID, Password and Login elements. I am sure even when using by name method website is loaded and is ready for use. Below is the screenshot of the Webpage login My

How to extract data from the following html?

随声附和 提交于 2021-01-31 07:27:52
问题 The Html from where i want to extract data is: <div class="infoMessageInner"> <p> <span ng-bind-html="servicesCtrl.texts.addressInfo" class="ng-binding"> Fiber är beställd till adressen. Tjänsterna kan du beställa när installationen är färdig. </span> <span ng-show="servicesCtrl.address.status === 'Orderable'" class="ng-hide"> <a ng-click="servicesCtrl.preScrollToVerticalPosition('checkout', 'checkout', '/checkoutFiber', undefined, 'Checkout fiber')">Till fiberbeställningen </a> </span> <span

How to extract data from the following html?

天涯浪子 提交于 2021-01-31 07:23:30
问题 The Html from where i want to extract data is: <div class="infoMessageInner"> <p> <span ng-bind-html="servicesCtrl.texts.addressInfo" class="ng-binding"> Fiber är beställd till adressen. Tjänsterna kan du beställa när installationen är färdig. </span> <span ng-show="servicesCtrl.address.status === 'Orderable'" class="ng-hide"> <a ng-click="servicesCtrl.preScrollToVerticalPosition('checkout', 'checkout', '/checkoutFiber', undefined, 'Checkout fiber')">Till fiberbeställningen </a> </span> <span

How to extract data from the following html?

Deadly 提交于 2021-01-31 07:22:16
问题 The Html from where i want to extract data is: <div class="infoMessageInner"> <p> <span ng-bind-html="servicesCtrl.texts.addressInfo" class="ng-binding"> Fiber är beställd till adressen. Tjänsterna kan du beställa när installationen är färdig. </span> <span ng-show="servicesCtrl.address.status === 'Orderable'" class="ng-hide"> <a ng-click="servicesCtrl.preScrollToVerticalPosition('checkout', 'checkout', '/checkoutFiber', undefined, 'Checkout fiber')">Till fiberbeställningen </a> </span> <span

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

左心房为你撑大大i 提交于 2021-01-29 22:11:33
问题 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')