I have a while loop that navigates to a webpage that I manually inspect. What I need to be able to do is press the enter key and have the counter stored. Ideally everything would work like this:
from selenium import webdriver as wd
import time
url = [www.example.com,www.google.com]
ff = wd.Firefox()
stored_url_number = []
i=0
while i<len(url):
ff.get(url[i])
time.sleep(5)
if enterispressed:
stored_url_number.extend(i)
i +=1
Is there a simple way to create an 'enterispressed' function in python?
Specifically, I want the program to run as normal to the next iteration unless enter is pressed, in which case I want it to perform the .extend(i) action and then move on.
Many thanks