xpath

Not able to get element by xpath inside div with ::before

这一生的挚爱 提交于 2021-02-11 02:01:21
问题 I need to get the list of web elements by using web driver object findElements(By.xpath("")); I get the list by using xpath as //*[@class=\"providers-list clearfix\"] .However, I get an error whenever I try to fetch element inside <div class="providers-list clearfix">::before <div class="data-container">..</div> </div> This xpath gives me error: // [@class=\"data-container\"]" as no such element: Unable to locate element: {"method":"xpath","selector":"// [@class="data-container"]"} 回答1:

Not able to get element by xpath inside div with ::before

微笑、不失礼 提交于 2021-02-11 01:59:03
问题 I need to get the list of web elements by using web driver object findElements(By.xpath("")); I get the list by using xpath as //*[@class=\"providers-list clearfix\"] .However, I get an error whenever I try to fetch element inside <div class="providers-list clearfix">::before <div class="data-container">..</div> </div> This xpath gives me error: // [@class=\"data-container\"]" as no such element: Unable to locate element: {"method":"xpath","selector":"// [@class="data-container"]"} 回答1:

Python selenium xpath geting text is empty

痴心易碎 提交于 2021-02-10 17:48:45
问题 So I have this link and I'm trying to obtain the text from this XPath //div[@class='titlu'] but for some reason sometimes I'm getting the text how it should be and other times I'm receiving an empty string even though the site is containing that text. What have I tried: wait = WebDriverWait(self.driver, 10) wait.until(EC.presence_of_element_located((By.PARTIAL_LINK_TEXT, "Ap. de lux 3 "))) e = self.driver.find_element_by_xpath(html_data.xpath) also: wait = WebDriverWait(self.driver, 10) wait

How to select an element based on a polyline using Selenium and Python?

孤街醉人 提交于 2021-02-10 15:41:21
问题 I am trying to select and click on an element in Selenium, but it doesn't have the typical tags, and the xpath changes on reload. The symbol stays consistent though, and I want to be able to select the button using the symbol. The HTML looks like this: <svg x="0px" y="0px" viewBox="0 0 40 34" enable-background="new 0 0 40 34" focusable="false" style="fill: rgb(255, 255, 255); stroke-width: 0px; width: 100%; --darkreader-inline-fill:#e8e6e3;" data-darkreader-inline-fill=""> <g fill="none"

Powershell update xml key value based on other key value

感情迁移 提交于 2021-02-10 14:57:14
问题 I'm trying to write some powershell that will update the value of a xml key value pair based on the value of another key value pair in the same node. Example xml: <?xml version="1.0" encoding="utf-8" ?> <configuration> <plugins> <plugin pluginType="plugin1" polling_internal="2" polling_unit="M" enabled="true"> <params> <add key="Server" value="server1.local" /> <add key="database" value="databasename1" /> </params> </plugin> <plugin pluginType="plugin2" polling_internal="2" polling_unit="M"

Powershell update xml key value based on other key value

独自空忆成欢 提交于 2021-02-10 14:55:13
问题 I'm trying to write some powershell that will update the value of a xml key value pair based on the value of another key value pair in the same node. Example xml: <?xml version="1.0" encoding="utf-8" ?> <configuration> <plugins> <plugin pluginType="plugin1" polling_internal="2" polling_unit="M" enabled="true"> <params> <add key="Server" value="server1.local" /> <add key="database" value="databasename1" /> </params> </plugin> <plugin pluginType="plugin2" polling_internal="2" polling_unit="M"

Unable to find the xpath of star using selenium & java

[亡魂溺海] 提交于 2021-02-10 14:13:14
问题 Thank you in advance ! url - https://www.tripadvisor.in/UserReviewEdit-g641714-d1156207-Club_Mahindra_Madikeri_Coorg-Madikeri_Kodagu_Coorg_Karnataka.html i need to hover on the stars and select the 5th star. please find my code :- private static void setRating(String star) { //new Actions(driver).moveToElement(driver.findElement(By.xpath("//*[@id='qid10']/option[1]"))).perform(); List<WebElement> rating = driver.findElements(By.xpath("//span[@class='ui_bubble_rating fl bubble_00']")); rating

Unable to find the xpath of star using selenium & java

梦想与她 提交于 2021-02-10 14:12:52
问题 Thank you in advance ! url - https://www.tripadvisor.in/UserReviewEdit-g641714-d1156207-Club_Mahindra_Madikeri_Coorg-Madikeri_Kodagu_Coorg_Karnataka.html i need to hover on the stars and select the 5th star. please find my code :- private static void setRating(String star) { //new Actions(driver).moveToElement(driver.findElement(By.xpath("//*[@id='qid10']/option[1]"))).perform(); List<WebElement> rating = driver.findElements(By.xpath("//span[@class='ui_bubble_rating fl bubble_00']")); rating

Unable to find the xpath of star using selenium & java

ε祈祈猫儿з 提交于 2021-02-10 14:07:50
问题 Thank you in advance ! url - https://www.tripadvisor.in/UserReviewEdit-g641714-d1156207-Club_Mahindra_Madikeri_Coorg-Madikeri_Kodagu_Coorg_Karnataka.html i need to hover on the stars and select the 5th star. please find my code :- private static void setRating(String star) { //new Actions(driver).moveToElement(driver.findElement(By.xpath("//*[@id='qid10']/option[1]"))).perform(); List<WebElement> rating = driver.findElements(By.xpath("//span[@class='ui_bubble_rating fl bubble_00']")); rating

How to select the auto suggestion from the dynamic dropdown using Selenium and Java

大城市里の小女人 提交于 2021-02-10 13:06:16
问题 I am trying to select the value for Subjects field in the following form: https://demoqa.com/automation-practice-form It is an input field that dynamically gives suggestions based on our input and later we need to select values from those suggestions. I am unable to select the desired value. The Below code only populates the input area but the value is not selected. driver.findElement(By.id("subjectsInput")).sendKeys("English"); driver.findElement(By.id("subjectsInput")).click(); //This line