I have a list and I would like to use a random choice from that list.
subjects = ['Beauty', 'Fashion', 'Hair', 'Nails', 'Skincare & Makeup', 'News']
random_item = random.choice(subjects)
print(random_item)
driver.find_element_by_xpath('//select[@name='input_4']/option[@value='random_item']').click()
I am able to print a random choice but (random_item
) is not working when used inside the driver.find_element_by_xpath
command.
Am I doing something wrong or is there something I should add to it?