a = input("How many Stocks: ")
if a == 1:
OneStock()
if a == 2:
TwoStock()
if a == 3:
ThreeStock()
if a == 4:
FourStock()
def OneStock():
a = input("Ticker: ")
PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)
driver.get("https://www.benzinga.com/quote/" + a)
def TwoStock():
b = input("1.Ticker: ")
c = input("2.Ticker: ")
PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)
driver.get("https://www.benzinga.com/quote/" + b)
driver.execute_script("window.open('about:blank', 'secondtab');")
driver.switch_to.window("secondtab")
driver.get("https://www.benzinga.com/quote/" + c)
def ThreeStock():
d = input("1.Ticker: ")
e = input("2.Ticker: ")
f = input("3.Ticker: ")
PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)
driver.get("https://www.benzinga.com/quote/" + d)
driver.execute_script("window.open('about:blank', 'secondtab');")
driver.switch_to.window("secondtab")
driver.get("https://www.benzinga.com/quote/" + e)
driver.execute_script("window.open('about:blank', 'thirdtab');")
driver.switch_to.window("thirdtab")
driver.get("https://www.benzinga.com/quote/" + f)
def FourStock():
g = input("1.Ticker: ")
h = input("2.Ticker: ")
i = input("3.Ticker: ")
j = input("4.Ticker: ")
PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)
driver.get("https://www.benzinga.com/quote/" + g)
driver.execute_script("window.open('about:blank', 'secondtab');")
driver.switch_to.window("secondtab")
driver.get("https://www.benzinga.com/quote/" + h)
driver.execute_script("window.open('about:blank', 'secondtab');")
driver.switch_to.window("secondtab")
driver.get("https://www.benzinga.com/quote/" + i)
driver.execute_script("window.open('about:blank', 'secondtab');")
driver.switch_to.window("secondtab")
driver.get("https://www.benzinga.com/quote/" + j)
The four functions aren't being executed after the input a. It just ends the program, any ideas? and btw before i added all Functions at the end but that did not work because all four functions were executed one by one. (whoever deleted this bevor was wrong, you said my problem was similar to another post but it did not help me at all, di not have anything to do with my problem)