Questions tagged [xpath]

XPath was developed with the main objective of targeting specific sections within an XML document. In addition, it offers essential functionality for modifying strings, numbers, and booleans. With its concise and non-XML syntax, XPath enables seamless manipulation. Instead of focusing on the surface-level formatting, XPath delves into the underlying logical structure of an XML file.

Guide on pressing the "Next" button on the Twitter login page with Selenium and Python

Currently, I am working on developing a Twitter automation bot using Selenium. However, I have encountered an error when attempting to log in and click on the next button after entering the user ID. I have experimented with various methods like xpath, lin ...

Choosing Selenium Web Elements

Currently, I am working with Selenium and encountering an issue with one of the Xpaths in relation to creating a Gmail account. The problem lies with selecting the birth month option on the page. The Xpath I have provided below appears to be correct when e ...

Selenium is unable to locate the XPath, yet it functions properly with jQuery

After encountering an issue with locating and clicking on a specific element using XPath in WebDriver, I discovered an interesting difference between the console in Chrome DevTools and the Find function. The XPath that was causing trouble was: //table[@t ...

Selenium throwing NoSuchElementException in IE7 browser

Having some trouble using Selenium on Internet Explorer 7 with InternetExplorerDriver on a Windows XP system. The code runs smoothly on Firefox, IE9, and even IE9 compatibility mode on Windows 7. Here is the HTML snippet: <HTML xml:lang="fr" xmlns="ht ...

Obtaining the source URL of an image from a curled HTML using the Document Object Model (

function fetchWebPage($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); curl_close($ch); return $result; } $pageContents = fetchWebPage(trim('http://lo ...

Element could not be found inside the pop-up dialog

I have been attempting to find those buttons displayed here: https://i.stack.imgur.com/5M1qd.png Here is the HTML for them: https://i.stack.imgur.com/238no.png I've experimented with different methods, but unfortunately, nothing has succeeded. ...

Locate an original identifier using Selenium WebDriver

In search of a distinctive identifier for the "update profile picture button" on my Facebook account to utilize it in automation testing with Selenium WebDriver and Java. I attempted driver.findElement(By.className("_156p")).click();, but unfortunately, i ...

Guidance on extracting the text value of $39 from the HTML using Selenium

The following HTML code displays the total amount: <h3 data-testid="cartSubTotalAmt" class="inline bottom-offset-0 pull-right ng-binding">$39.00</h3> https://i.stack.imgur.com/0IDt0.png I am looking to retrieve the total summary value of $39 ...

How to use Nokogiri to efficiently extract targeted nodes from HTML

In my Ruby script, I am trying to extract specific values from an HTML document using the Nokogiri gem. The HTML content I'm parsing includes information about a user and their registered device. #!/usr/bin/ruby require 'Nokogiri' doc = Nokogiri::HTML(&l ...

Searching for the #document element using Python with Selenium WebDriver

While working with Python's Selenium Webdriver, I encountered a challenge when trying to access elements within an #document tag using the following HTML code. I attempted both driver.find_element_by_xpath("html/body/div[@id='frame']/ifram ...

The problem with DOMdocument and Xpath array pairing

I'm currently experiencing some difficulties with file_get_contents, DOMdocument, and Xpath. I am attempting to perform some web scraping. I have created an array of website links to scrape: array(5) { [0]=> string(34) "https://lions-mansion.jp/M ...

Obtaining Array of Items using XPath in Selenium

Currently, I am working on automating my monthly expense report process through Selenium and Python. Although I can successfully log in and navigate to the list of expenses, dates, and locations, I am encountering difficulties when trying to save them to a ...

Discover the XPATH for selenium in VBA programming

I am currently facing a challenge with a web page hosted on a secure website. I have attached a snapshot of the specific section I am troubleshooting. The XPATH that identifies the rows of a table (totaling 13 rows) is: //div[@id='Section3'] However, the ...

Ways to exclude the text within an anchor tag using XPath

How can I extract the error message "Error Message: Invalid Entry" without including the 'x' in between? <div id="super" class="small-00 columns"> <div id="sub" class="sub error"> Error Message: Invalid Entry <a href="#" ...

Tips on creating a CSS Selector with Inner Text

Seeking assistance with CSS selector for the element below. There are several elements with the same class name, and the CSS selector should be based on inner text. <div class="title kpi-tile3-title o9-tooltip" data-o9title="Safety Stoc ...

I am having difficulty locating or clicking on an element on my page using Selenium, Python, findelement, and Xpath methods

I am facing difficulty in locating an element on a webpage after logging in successfully to the website. My goal is to click on a button that appears only after midnight to participate in an activity. However, I do not want to stay glued to my PC just to ...

Leveraging CSS Selectors or Xpath for data extraction within Scrapy

Trying to extract the value from this specific link: The desired information is: 42 677 17 00. I attempted using the scrapy shell with the command: response.css('td.line-content::text').extract(), but it returned an empty result. I then tried using xpat ...

Discovering a specific element within a nested element using Selenium WebDriver

I have encountered an issue while trying to search for an element within a sub-element using Selenium (Version 2.28.0). It seems that Selenium does not restrict its search to the specified sub-element. I am unsure if my approach is incorrect or if there is ...

Selenium Python is having trouble finding the element

While utilizing Selenium in Python, I encountered a challenge with inputting information into the expiration date and CVV fields. These fields are located within iframes, and although I successfully entered the credit card number, the other fields remained ...

Creating a dynamic XPath expression with a variable in Python for Selenium using %s

I have been attempting to utilize selenium in order to find and choose a specific element based on a variable that is passed into the function when it is called. Initially, I thought this task would be straightforward using the following code: show = brow ...

Having issues extracting the .text from the first two elements of a list when iterating through li tags using Selenium

When attempting to iterate through a li tag on the operator tab at this link, I encountered an issue where the first two operators in the list were being skipped, while the rest displayed correctly. I tried both implicit and explicit waits to address this ...

Extracting elements using Node.js and Selenium

I'm currently experimenting with Selenium and nodeJS for the first time. I'm trying to parse an HTML page and am running into issues when attempting to perform a deeper search using XPATH on returned elements. Below is my code: async function par ...

filtering out specific sections of HTML using xPath

I am currently attempting to scrape information from this page My approach involves using xPath to select specific elements. Here is a snippet of my code: $safeFlag = true ; //*[@id="tabset_productPage"]/dd[1]/div/div //HAVE TRIED THIS TOO //*[@id="tab ...

Utilizing Scrapy for Extracting Size Information obscured by Ajax Requests

I am currently trying to extract information about the sizes available for a specific product from this URL: However, I am encountering difficulty in locating the details hidden within the Select Size Dropdown on the webpage (e.g., 7 - In Stock, 7.5 - In ...

Can I combine Following and preceding in Selenium for testing?

https://i.stack.imgur.com/tDnqb.pngAs I explore the content on this page https://en.wikipedia.org/wiki/Trinity_Seven#Episode_list here's what I have encountered: //*[text()='Reception']//preceding::th[contains(@id, 'ep')]//following::I However, it seems ...

Selenium can locate an element by its CSS selector that comes after a specific element

How can I locate the text "Interesting" which is the first occurrence of the class b after h1.important when using Selenium? <div class="a"> <div class="b">Not interesting</div> </div> <div class="title"> <h1 c ...

Tips for extracting a number from a div block with xPath

Recently, I started learning about xPath and encountered a challenging task. I need to extract the text "22 973 ₴" from this code snippet. Can anyone advise me on how to achieve this? <div class="col search_price discounted responsive_secondrow ...

Navigating XML documents in PHP using OTA standards

While I have a basic understanding of utilizing Xpath in PHP, I am currently facing difficulties with a specific scenario. Initially, I suspect that the issue lies within the standards. The following XML snippet adheres to the OTA standards: <SendHote ...

Using Selenium to retrieve a compilation of all URLs within a closed issue page on GitHub

I am attempting to save the links of all the resolved issues from a GitHub project (https://github.com/mlpack/mlpack/issues?q=is%3Aissue+is%3Aclosed) using Selenium. The code snippet I am using is: repo_closed_url = [link.find_element(By.CLASS_NAME,'h ...

Accessing Gmail inbox through Selenium WebDriver in Java for opening emails

Is there a method in Selenium WebDriver with Java in the Eclipse IDE that allows for opening Gmail inbox emails using XPath? ...

Steps for selecting a specific checkbox

I need to interact with the "Select page" checkbox located in the drop-down menu labeled as "All". Here is the HTML code: <ul class="list-unstyled"> <li> <input id="selectAllTop" name="selectAllCheckBox" attr-sel="All" type="ch ...

Discover the solution by utilizing XPath

I am struggling to extract data from an HTML table: <div class="parameters"> <div class="property">property 1</div> <div class="value">value</div> </div> <div class="paramete ...

Storing blank information into a Mongodb database with Node.js and HTML

Can someone please assist me with solving this problem? const express=require("express"); const app=express(); const bodyparser=require("body-parser"); const cors=require("cors"); const mongoose=require("mongoose"); ...

Master the art of capturing the Auto Suggest Pop Up notification using Selenium

I'm currently attempting to capture a pop-up message that appears when the cursor is placed in the "Choose Your Username" text box on the Gmail create account page. The message says "You can use letters, numbers, and periods." I want to save this message i ...

I'm using Selenium XPATH or CSS to identify and select a checkbox within an HTML table based on the specified text. As a result, I have successfully

I am trying to select a checkbox from an HTML table with multiple columns. Specifically, I want to choose the checkbox that corresponds to the "CLEAN_AUDIT" option for the Name column. However, my current XPATH is selecting 4 checkboxes labeled CLEAN_AUDIT ...

Utilizing Selenium and Python to Choose an Option from a Dropdown Menu

How can I extract the visible text 'planned works' from this HTML drop-down list? <select id="NewEnquiry.Purpose" data-bind="options: SelectablePurposes, value: Purpose, optionsText: 'Name', optionsCaption: '-- Pl ...

Finding element in the HTML document using parent element's xpath in Selenium

I'm having trouble selecting a checkbox within a table td element using Selenium. The xpath locator I am currently using is "//*/td/a[contains(.,'Samsung Galaxy Note 10.1')]//parent::td[last()]/input[@type='checkbox']". I want to be able to click on the ch ...

Python code for searching XML elements with namespaces using XPath queries with specific tags and attributes

It seems like I must be missing something fundamental here, as every example I find and read on SO suggests that this should work. My goal is to utilize an XPath search with the lxml etree library to extract information from a Garmin TCX file: <?xml v ...

Checking for URL redirection in Selenium automation can be done with the following steps

Attempting to automate the verification of top navigation links on . https://i.stack.imgur.com/Mt6Zw.png When comparing actual URLs with expected URLs in the page class method, the line below returns null. I'm not sure why. String urlp = locator.all_topn ...

Locate an element by xpath using just the initial portion of the attribute value

I am trying to locate elements that share a common partial attribute value. Is it possible to find a list of elements by just using part of the attribute value? Here are the elements in question: <div data-fields="productLIFiveYr" style="overflow: hi ...

Utilize Selenium and Python to retrieve a collection of text items from a g element inside an svg tag

I am trying to extract specific text fields that are located within a <g> tag nested inside an <svg> tag. The website I am working on is: . My goal is to input a company name, search for it, expand the last drop-down menu, and extract informati ...

Choosing Checkboxes with Selenium

I'm attempting to utilize Selenium to interact with a checkbox, as indicated in the HTML image. The issue is that all four options have the same checkbox input tag, and their unique identifier is only specified by the id="country_england" .... I ...

Using the power of Selenium's XPath, we can easily navigate through a table to access

Looking for assistance in creating selenium xpath for the various column links within a table. Each row has a unique identifier and contains information about a product, including the name. Based on the product name, I need to locate other links within the ...

Error encountered when attempting to send text to an element inside an iframe: NoSuchElementException in Selenium

Hello everyone, I am a beginner in Python and recently started exploring Selenium. I have successfully completed small projects for LinkedIn or Twitter following tutorials. Now, I want to create something related to my work in finance. However, I am facing ...

Python Selenium Webdriver - Interacting with a button using a dynamic selector

I'm currently working on an automation project and facing a challenge with clicking this button using a selector. <button id="ember2570" class="ember-view btn btn-default btn btn-default" type="button"> <i class="fa fa-upload"></i&g ...

Splinter: Extracting XPATH text fragments that do not comprise distinct elements

How can I extract and store the text of the first, underlined, and last parts of the question using Splinter? Refer to the HTML below. I aim to assign the following values to variables: first_part = "Jingle bells, jingle bells, jingle all the" second_par ...

Error encountered while utilizing By.Xpath: NoSuchElementException

Update : After some trial and error, I managed to make it work by placing the element inside an iframe: WebDriverWait wait = new WebDriverWait(_driver, 60); wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By .xpath("//*[@cla ...

Unable to find an error message within Selenium for validation

I was attempting to create tests to verify mandatory fields. One of these obligatory fields is labeled as "Document ID". I managed to locate its XPath and verified it in both Firefox and Chrome, where it worked fine. However, when implementing the same XPa ...

What is the best way to locate an element on a website that consistently changes its label ID buried deep within nested DIVs?

I'm facing an issue with my website tracking system, where I am trying to extract shipment details using Selenium in Python and save them to an Excel file. However, I am encountering difficulties with getting Selenium to function properly. It keeps sh ...

Leverage the power of DOMXPath in combination with the query function

Here is a snippet of HTML code to work with: <ul id="tree"> <li> <a href="">first</a> <ul> <li><a href="">subfirst</a></li> <li><a href=""> ...

A guide on utilizing Selenium to choose an option within a dropdown menu featuring an AJAX onchange attribute

After browsing several pages on stackoverflow, I have not been able to find a solution to my current problem. My goal is to automate a work process using selenium (python). This process requires logging into a web portal, selecting specific search criteria ...

Find the Xpath to locate the image source on the Flipkart website

Looking for the XPath to click on an image in the mobiles section of Flipkart's website, specifically the realme shop. I have identified the necessary XPath and prepared the code as follows: package Test; import org.openqa.selenium.By; impo ...

What is the best method for creating a Selenium locator for the element provided?

I'm working on creating an Xpath to target and click on a specific radioButton. Take a look at the element and Xpath below: Xpath: /html/body/div[3]/div[2]/form/table/tbody/tr[5]/td[2]/label[1]/input Element: <input type="radio" ng-model="dat ...

Tips for adding an attribute to an XPath query

Currently, I am utilizing selenium to navigate through various pages. Here is an example of the page source: <td colspan="10" align="right"> <input type="button" name="previous" value="Previous" onclick="this.form.action = 'coca-c ...

Utilizing storeXpathCount function along with contains in xpath within Selenium IDE

Attempting to calculate the number of rows in a table that contain the value "ICETS" in the second column, using the following code: <tr> <td>storeXpathCount</td> <td>//table[@id='DataTables_Table_0']/tbody/tr[contains(td[2], " ...

Leveraging regular expressions to target elements with dynamic numerical values embedded within xpath patterns

Within my application, I encounter emails in the inbox with unique IDs. Unfortunately, clicking on the first email is proving to be a challenge due to the constantly changing mail ID. The specific xpath looks like this: //*[@id='r1295']/td[4]/a ...

Collecting information from an HTML table with the use of xpath and either LXML or selenium

Looking to scrape data from an HTML table on a specific webpage: Visit this link I am utilizing Python, selenium, and lxml with xpath for this task. The challenge lies in extracting match odds that are spread across two rows: first in tr followed by tr ...

Struggling to use XPath to interact with a pop-up window in Selenium

Is there a way to retrieve 'CIK' codes from the 'SEC' using Selenium? When I try running the code, a "survey" pop-up appears that doesn't show up when doing it manually. This causes issues with my code because I can't inspect ...

Unable to select checkbox within a table using Selenium WebDriver with Java

Having trouble checking a checkbox inside a table using Selenium Webdriver in Java? Even with version 2.52.0 of Selenium, the element not found error persists across different web browsers. The iFrame seems to be correct as I can interact with other compon ...

Python with Selenium can be used to raise a TimeoutException with a specific message, screen, and stack trace

from selenium import webdriver from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait url = "https://www.electionreturns.pa.gov/General/OfficeRe ...

org.openqa.selenium.InvalidSelectorException: The element cannot be found using the xpath expression provided by con_reader.getusermobile()

While implementing the object repository in a base class using the page object model, I encountered an issue where Selenium was unable to identify the element and returned an invalid selector exception. Below are the classes I executed: Package Failed_S ...

Struggling to find a specific element on a website with Xpath in Selenium using Python

Attempting to retrieve data from a website named: , specifically targeting the element: /html/body/div[1]/div/main/div/div[2]/div/div[2]/div/div/div[1]/div[4]/div[2]/div[1]/div[1]/div[2]/span[2] which displays volume as a number on the webpage. The code I ...

Exploring the potential of XPath wildcards within attributes in Selenium WebDriver

Is there a way to use wildcards in XPath attributes? I currently have this regular XPath example: //input[@id='activation:j_idt84:voId:1']` What I am trying to achieve is to replace the number after 'j_idt' with a wildcard since it ch ...

Selenium is struggling to identify the XPath displayed on the developer tools

https://i.stack.imgur.com/enl7F.jpg https://i.stack.imgur.com/LNQW9.jpg I am currently facing an issue with validating the visibility of a comment I posted on my profile. The comment appears on my wall and profile feeds, but Selenium is unable to recogni ...

The xpath expression "//div[contains(@class='loader-overlay')]" has been deemed invalid for use with Selenium

When updating from version 2.53 to version 3.14, Selenium is giving an error message that says: The xpath expression "//div[contains(@class='loader-overlay')]" is invalid This piece of code is causing the issue: System.setProperty("webdriver.gecko.drive ...

Guide to selecting the element labeled SRP Banner in the HTML using Selenium and VBA

My attempt to click on a href using Selenium VBA in a webpage is resulting in an error message. The following code snippet shows what I have tried so far: Sub test() Dim Driver As New Selenium.FirefoxDriver Driver.Get "http://sums.99acres.com/sum ...

Exploring Selenium: Unraveling the Contrast between @FindBy and WebElement.findElement()

I am currently utilizing Selenium for testing my User Interface. My goal is to implement the @FindBy-Annotation in my code. The first snippet of code below works without any issues: @FindBy(how=How.XPATH, xpath ="//input[contains(@id,'idOfInputField')]") ...

Searching for elements using XPath in Java with Selenium

While developing a web application, I encountered difficulty in locating a specific element using xpath. The HTML code containing the element I need to find is as follows: <table> <tr> <th class="details"> <lab ...

Having trouble with clicking the Sign-in button

<div class="form-group dl-padding-10"> <select class="form-control form-control-solid" name="SelectedRoleID" id="SelectedRoleID" onchange="removeBorderColor()" required=&qu ...

Extracting all Twitter links from a webpage with RSelenium

I'm encountering an issue while attempting to extract URLs from a webpage using Rselenium. I keep receiving an InvalidSelector error. My setup consists of R 3.6.0 on a Windows 10 PC, with Rselenium 1.7.5 and Chrome webdriver (chromever="75.0.3770.8") ...

Python Selenium: Variable encoding gets altered by XPath

I am facing an issue with my code that uses XPath to search through text. The problem arises when the text being searched contains special Latin characters like ñ or í. After encoding the text, it displays correctly when printed. However, the issue occu ...

Locating and selecting a boolean checkbox with Selenium and Java: A step-by-step guide

I'm currently attempting to click a primefaces select boolean checkbox using the ID, but I'm encountering an issue. The exception message states: org.openqa.selenium.NoSuchElementException: Cannot locate an element using By.id: runDARtest1 I&ap ...

Can one effectively retrieve data from Android SQLite database by querying JSON information?

Can Android SQLite databases be queried for JSON data, similar to how XML data can be stored and queried in sql-server using xpath? Is it possible to do something like this with sqlite? ...

Get the number of elements that match your XPath expression

Currently engaged in an XML and XSLT project with a challenging task; the query requires me to count the number of open ports with a specific port number using the following path: liste_hotes --) hote --) liste_ports --) port num_p ...

XPath allows for the selection of both links and anchors on a webpage

Currently, I am using Screaming Frog and seeking to utilize XPath for a specific task. My objective is to extract all links and anchors that contain a certain class within the main body content, excluding any links found within div.list. I have attempted ...