[Tip] Selenium finding the sign in link by link text not working

In the Complete Python Mastery course I got stuck on the browser automation lecture.

After a few trial and errors to find the Sign in link by the link text I realized that when the browser window is narrow the sign in link is hidden due to responsive design.

This was not allowing selenium to find the element.

I ended up adding the code to maximize window so that the link is visible, thus could be found and clicked.

Hoping this tip saves some time to those scratching their heads trying to figure out why it is not working.

from selenium import webdriver
browser = webdriver.Chrome()
browser.get("https://github.com")
browser.maximize_window()
signin_link = browser.find_element_by_link_text("Sign in")
signin_link.click()

I had the same issue, the syntax changed:
https://selenium-python.readthedocs.io/locating-elements.html

from selenium.webdriver.common.by import By

signin_link = browser.find_element(By.LINK_TEXT, “Sign in”)