[
``There are country name in this link -https://www.globalsqa.com/demo-site/select-dropdown-menu
and I have and excel sheet. I just want to see if all the names can be selecting (as I am practicing drop down menu) suppose I have a country which is in excel file but not in the link(https://www.globalsqa.com/demo-site/select-dropdown-menu)
just want to know how I can pass it and in excel sheet I want to print country not found .
Please assist I am a beginner in python.
import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select
import openpyxl
service_obj = Service("/Users/mylearning/Documents/webdriver/chromedriver.exe")
driver = webdriver.Chrome(service=service_obj)
path = '/Users/mylearning/Desktop/multipleDropdown/desh.xlsx'
wb = openpyxl.load_workbook(path)
sh1 = wb.active
c_count = sh1.max_column
r_count = sh1.max_row
print(r_count, c_count)
url= "https://www.globalsqa.com/demo-site/select-dropdown-menu/"
driver.maximize_window()
driver.get(url)
driver.implicitly_wait(2)
for r in range(2, r_count+1):
dropdown = Select(driver.find_element(By.XPATH,'//*[@id="post-2646"]/div[2]/div/div/div/p/select'))
````dropdown.select_by_visible_text(sh1.cell(row=r, column=1).value)
```
sh1.cell(row=r,column=2).value="completed"
wb.save(path)````
````](https://stackoverflow.com)`
New contributor
Gauri Sharma is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.