Python Selenium Webdriver: AttributeError 'list' object has no attribute 'tag_name'
<p>I am having a trouble with the select element when I try to run my code it gives me an error</p>

<pre><code>AttributeError 'list' object has no attribute 'tag_name'
</code></pre>

<p>like I don't have any select element. Is it because it is not focusing on popup? What am I doing wrong?</p>

<p><a href="https://i.stack.imgur.com/I29e0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I29e0.png" alt="enter image description here"></a></p>

<p>MyCode.py</p>

<pre><code>from selenium import webdriver
from selenium.webdriver.support.ui import Select

browser = webdriver.Firefox()
browser.get("http://www.punjnud.com/PageList.aspx?BookID=14050&amp;BookTitle=Ali%20Zaryoun%20Ki%20Ghazalein")

popupSelect=Select(browser.find_elements_by_xpath("(//select[@class='custom-dropdown selectdrop'])[1]"))

popupSelect.select_by_value("1")

browser.find_elements_by_class_name("btn btn-success").click()
</code></pre>

<p>Error in select.py:</p>

<pre><code>if webelement.tag_name.lower() != "select":
    raise UnexpectedTagNameException("Select only works on &lt;select&gt; elements, not on &lt;%s&gt;" %webelement.tag_name)
</code></pre>

<p>Exception:</p>

<pre><code>AttributeError: 'list' object has no attribute 'tag_name'
</code></pre>