I’m trying get the list of texts from the filter area. What is the XPath I should use? Sorry, I’m not good at XPath.
Thanks in advance for any help.
*edited
You can use classname as xpath to retrieve texts.
(//div[#class="fe"])[1]
Related
I am very new to Xpath and html. Could anyone please tell me how to use xpath to extract the text ('Nicht verfugbar') shown in the attached pic?
Thanks a lot!
The web page I am talking about here is
https://de.louisvuitton.com/deu-de/produkte/nano-speedy-monogram-010575
You can try with
//span[#class='lv-stock-indicator lv-product-stock-indicator lv-product__stock list-label-m -not-available']/text()
The class of the span is unique, so it can be used for location.
More info:
https://www.guru99.com/xpath-selenium.html
I am trying to capture "Featured Courses" using either an xpath or CSS selector on the following link qaclickacademy website. Below is what I have tried.
By.xpath("//div[contains(concat(" ",normalize-space(#class), 'text-center'), " Test ")]");
Would you like to help me, please?
If you use the xpath //ul[#class="gallery course-list"] you'll get all the licontaining courses.
If you want the link in each a element you should try this:
//ul[#class="gallery course-list"]//a/#href
Snapshots displayed Field as well as Inspect element code. Always faced problem on writing xpath for table element. Xpath copied from Moxilla firbugs is worked sometimes but not always.. can any one tell how to write xpath of above code.... Thanks
You can use this xpath
//table[#class='detailList']/tbody/tr/td[contains(text(),'Business Lease')]
abc
I am not able to locate above element. I tried //*[#id="contact-groups"], but with no success.
Well, XPath is not the best of the methods to find elements. But following will match the links with href = "#".
//a[#href="#"]
Not sure if your scenario is as simple as your question. I did test this with a simple html page.
The locator seems correct. You could try this too:
.//*[#id='contact-groups']
As per HTML code provided you can try below xpaths
//a[#id='contact-groups']
//a[contains(text(),'abc')]
//a[#href='#']
Thanks
I am guessing the link is in an Iframe.
Use the following code to switch to the frame and then click on the link
driver.switchTo().frame("frame-name");
driver.findElement(By.xpath("//a[#id='contact-groups']")).click();
I want to match links like foo, but this doesn't work only works in Nokogiri:
doc/'a[href ^="mailto:"]'
What's the right way of doing that? How do I do that with Hpricot?
doc/"//a[starts-with(#href,'mailto')]"
This works on Hpricot:
doc/'a[#href ^="mailto:"]'
Couldn't figure out a way to do the xpath search though. Apparently, Hpricot doesn't support starts-with: http://wiki.github.com/hpricot/hpricot/supported-xpath-expressions