actually, I just refactored my code and now it seems to not be doing it anymore (?). I ended up putting the login information & a time delay inside a try: except: and it seems to not be needing to log in each time anymore!
My code before was in separate login and looping functions, roughly like this (sorry for the silly pseudocode, I don't know why Chrome is not letting me paste text into this box?):
def login_fcn():
browser.get(url)
find username element
give it the username
find password element
time.sleep(5)
return browser
def loop_url_list(browser):
for item in url_list:
browser.get(item)
do something
That wasn't working because it was logging out and couldn't log back in each time. So I refactored and now it looks more like this:
def log_in_and_do_stuff():
browser = webdriver.Firefox()
for url in url_list:
browser.get(url)
try:
(same login and password stuff as above)
except selenium.common.exceptions.ElementNotVisibleException:
print "don't need to log back in again, going on"
do some other stuff
hope that helps -
sam