I'm using Selenium with Python 3.5 to scrape various websites. However, I need to select from a drop-down list but keep getting an error. I'm quite embarrassed I can't get this to work, but XPath is brand new to me so your help is appreciated. The truncated version of my code is:
driver.implicitly_wait(4)
driver.find_element_by_xpath("//select[@id='ddaShowForm']/
option[@value='Deposits']/text()").click()
I have the wait there to make sure the page is fully loading because that was something that got me before. The error I'm getting is that it can't find the element. Thanks for your help!
Here is a snippet of the relevant area of the page. I'm sorry for the poor formatting.
<form id="ddaShowForm" action="https://online.wellsfargo.com/das/cgi-bin/session.cgi?sessargs=xUog_f8DdTZHif-5iVUuuwe9XQVqncvm" method="post">
<label for="transactionType">Show: </label>
<select id="transactionType" name="showTabDDACommand.transactionTypeFilterValue">
<option value="All Transactions" selected="selected">All Transactions</option>
<option value="All Transactions One Column">All Transactions in One Column</option>
<option value="All Transactions with Balance">All Transactions with Balances</option>
<option value="Bill Pay">Bill Pay Transactions</option>
<option value="Check Card">Debit Card / ATM Card Transactions</option>
<option value="Checks">Checks</option>
<option value="Deposits">Deposits</option>
<option value="Withdrawls">Withdrawals</option>
<option value="transactionTypeFilter.p2p.label">WF SurePay</option>
<option value="transactionTypeFilter.wire.label">Wires</option>
</select>
<label for="timeFilter"> for </label>
<select id="timeFilter" name="showTabDDACommand.timeFilterValue" size="1">
<optgroup label="" >
<option value="3" selected="selected" >Last 90 Days</option>
<option value="4" >Last 6 Months</option>
<option value="5" >Last 12 Months</option>
<option value="6" >Last 18 Months</option>
<option value="7" >Since Last Logon</option>
<option value="8" >Since Last Statement</option>
<optgroup label="--------------------" class="optgroupstyle"></optgroup>
<option value="11" >Date Range</option>
</optgroup>
</select>
HTML