Fill in web form using Python
<p>I've been trying to fill in a web form using Selenium in Python. It's a simple enough task, and the code I'm using is this:</p>

<pre><code>from selenium import webdriver
from selenium.webdriver.common.keys import Keys

driver = webdriver.Firefox()
driver.get("https://...")
elem = driver.find_element_by_id("receipt_number")
elem.clear()
elem.send_keys("13lettercode")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()
</code></pre>

<p>After inspecting the web form element I got this:</p>

<pre><code>&lt;input id="receipt_number" name="appReceiptNum" type="text" class="form-control textbox" maxlength="13"&gt;
</code></pre>

<p>The website gives me an error saying that my code is invalid, and I'm wondering if there's anything obvious that I'm doing wrong. Thanks for your help!</p>

<p>click the submit button instead of sending a return key</p>

python selenium-webdriver