0

Hi guys I want to find the X path of the capital city of the country by using the country.Help me in finding the X path. I have used independent and dependent X path but not able to find it.

Link of website - https://www.countries-ofthe-world.com/capitals-of-the-world.html

I tried to find the X path of the city by using country name. enter image description here

1
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
    – Community Bot
    Commented Jul 1 at 18:21

1 Answer 1

1
//table//td[text()='Mali']/following-sibling::td

You can replace the country using a variable depending on the programing language u use. So that when you pass the country name, this xpath would point to capital of the country

2
  • Could you please ping one example. Commented Jul 2 at 7:13
  • "//table//td[text()='"+CountryName+"']/following-sibling::td" this is in Java where Country name is the variable
    – Sonali Das
    Commented Jul 3 at 5:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.