0

I am trying to select the last option and, I am stuck at this stage. is there any way to directly select a 2000 option by XPath.

Thanks to everyone, I edited my question and, I have come up with an Xpath solution.

Here is the code:

    obj = Select(driver.find_element_by_xpath("//div[@id='pagerA']//div//font//select"))
obj.select_by_value("2000")

enter image description here

  • 1
    First two lines are Python, the third is a mix between C# and Java/Python. You should also explain what is the problem, *anyone could help me out* is not a question. – Guy Jan 20 '20 at 07:41
  • You're using python and there's no `FindElement` method, you mixed up with C#. Use `driver.find_element(By.XPATH, "")`. – Sers Jan 20 '20 at 07:51
  • `driver.FindElement(By.XPath())` is C#, you want `driver.find_element_by_xpath()` – Guy Jan 20 '20 at 07:53
  • Sorry about that, I have edited my question. I found this "following::span[1]" somewhere here while I was looking for a proper way to do so. – Mahyar Azad Jan 20 '20 at 07:54
  • I am using Python and, I also tried driver.FindElement(By.XPath("//font[@class='selectPage']") – Mahyar Azad Jan 20 '20 at 07:55
  • Does this answer your question? [Selenium (Python) - SELECT](https://stackoverflow.com/questions/32382415/selenium-python-select). Also you can find helpful information about Selenium Python [here](https://selenium-python.readthedocs.io/navigating.html) – Sers Jan 20 '20 at 07:56
  • @Sers Thanks for your tips though it didn't work on my case – Mahyar Azad Jan 20 '20 at 11:42
  • 1
    Can you share the URL? What error do you get? Update the question with latest code you tried. – Sers Jan 20 '20 at 11:51
  • Unfortunately, I cannot share it. It's the company's web server that keeps confidential data. – Mahyar Azad Jan 20 '20 at 12:36

0 Answers0