Newbie to automation with Selenium/Python. I'm getting blocked automating a sign up form. The drop down is a required element but I'm getting the following error...
AttributeError: 'str' object has no attribute 'tag_name'
I've posted my code below and can't find any answer online as to why this would be. Any/all help greatly appreciated.
from selenium import webdriver
from selenium.webdriver.support.select import Select
teamElement = browser.find_element_by_id('id_team')
time.sleep(2)
sel = Select('teamElement')
sel.select_by_value("12")
The error is coming from the sel = Select('teamElement') line.
Traceback (most recent call last):
File "/Users/jamesstott/PycharmProjects/basics/RunChromeTests.py",
line 40, in <module>
sel = Select('teamElement')
File "/Users/jamesstott/PycharmProjects/venv/lib/python3.6/site-packages/selenium/webdriver/support/select.py", line 36, in __init__
if webelement.tag_name.lower() != "select":
AttributeError: 'str' object has no attribute 'tag_name'