So I started learning selenium(python) about a two weeks ago and now I'm making my own simple project. It takes the input from the user(name of the website or some random subject), then types the input of the user into the search bar, then it clicks on the first given link and scrapes all the text(paragraphs) of the website and saves it in an txt file. I have to mention that I ran that script before on a windows laptop and now I'm using a MacBook Pro. On a windows machine this problem did not occur but on the MacBook the selenium seems to skips the elem.send_keys(Keys.RETURN) and always clicks on the gmail link so basically it does not wait for the search to happen. Honestly I don't know how to tackle this issue I tried searching the web for similar problems but didn't find anything. Here is the part of the code where the problem happens..
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
subjectName = str(input("Enter the name of the subject: "))
driver = webdriver.Safari()
driver.get("https://www.google.com")
elem = driver.find_element_by_name("q")
elem.send_keys(subjectName)
elem.send_keys(Keys.RETURN)
results = driver.find_elements_by_tag_name(
"a") # finds webresults
results[0].click() # clicks the first one