xpath

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")){

How to paginate through the page numbers when href contains javascript:__doPostBack()

三世轮回 提交于 2021-02-02 09:35:34
问题 I'm trying to scrape this website http://www.mfa.gov.tr/sub.ar.mfa?dcabec54-44b3-4aaa-a725-70d0caa8a0ae but when I want to go to next page I can't because the link doesn't change you will find that pages links are like that href="javascript:__doPostBack('sb$grd','Page$1')" I have a code that I tried but it only goes to page 2 and then gave me an error: tale element reference: element is not attached to the page document from selenium import webdriver url = 'http://www.mfa.gov.tr/sub.ar.mfa

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

web scraping for javascript __doPostBack contain a herf in td

帅比萌擦擦* 提交于 2021-01-31 07:29:48
问题 I want to scrape a website i.e. is https://www.unspsc.org/search-code/default.aspx?CSS=51%&Type=desc&SS%27= using selenium but I am able to scrape only one page not other pages. Here I am using selenium from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC chromeOptions = webdriver.ChromeOptions()

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

web scraping for javascript __doPostBack contain a herf in td

一笑奈何 提交于 2021-01-31 07:25:44
问题 I want to scrape a website i.e. is https://www.unspsc.org/search-code/default.aspx?CSS=51%&Type=desc&SS%27= using selenium but I am able to scrape only one page not other pages. Here I am using selenium from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC chromeOptions = webdriver.ChromeOptions()

web scraping for javascript __doPostBack contain a herf in td

*爱你&永不变心* 提交于 2021-01-31 07:24:19
问题 I want to scrape a website i.e. is https://www.unspsc.org/search-code/default.aspx?CSS=51%&Type=desc&SS%27= using selenium but I am able to scrape only one page not other pages. Here I am using selenium from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC chromeOptions = webdriver.ChromeOptions()