How to test non-standard drop down lists through a crawler using Selenium and Python

Consider following the steps & lines of code to open the url & click on a menu:

  • Install current version of selenium through pip
  • Download the latest chromedriver.exe and provide the absolute path in your script
  • Code Block:

    from selenium import webdriver
    driver=webdriver.Chrome("C:\\Utility\\your_directory\\chromedriver.exe")
    #maximize the browser window
    driver.maximize_window()
    #open the url in the browser
    driver.get("https://www.mirrorfiction.com/zh-Hant/book/406")
    #click on the first menu item 小說
    driver.find_element_by_xpath("//nav[@id='nav']/div/ul/li/a/span[@class='text novel']").click()