On the website https://www.aliexpress.com, I need to change the country from the dropdown menu using selenium
>
you can use ActionChains. Element is your xpath
from selenium.webdriver import ActionChains
actions = ActionChains(browser)
actions.move_to_element(element).perform()
actions.click().perform()
You can read more about ActionChains here https://www.selenium.dev/selenium/docs/api/py/webdriver/selenium.webdriver.common.action_chains.html
or you can use click() function
example:
country_button = browser.find_element_by_class_name('ship-to')
country_button.click()