I started messing around with Python networking using selenium on Firefox. Unfortunately, I keep getting "ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine".
However, this only happens when running some commands, and it only happens the first time I run them. If execute the command a second time right after that, it works. (See below for a minimal example.)
I found this question, but being a networking newbie I'm having a hard time applying the solution to my situation. How do I prevent the connection from shutting down?
Any help is greatly appreciated!
from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://www.google.com/')
searchfield = browser.find_element_by_id("lst-ib") # Runs without issues
searchfield.get_attribute("value") # Produces WinError 10053
searchfield.get_attribute("value") # Returns '' as it should
EDIT: It seems the error only occurs, when I execute the command in the shell, rather than saving and running the whole script. Nonetheless, it's pretty annoying.