I keep getting the error: Unable to locate element: {"method":"css selector","selector":".user-profile-link"} - Everythin works Ok except for this error and I have tried to search for a solution with no success. Please help. Note that in the code I pasted below, I replaced my real username and password with "my_github_username" and "my_github_password" respectively.
enter code here from selenium import webdriver from selenium.webdriver.common.by import By
browser = webdriver.Chrome()
browser.get("https://github.com/")
browser.maximize_window()
signin_link = browser.find_element(By.PARTIAL_LINK_TEXT, "Sign in")
signin_link.click()
username_box = browser.find_element(By.ID, "login_field")
username_box.send_keys("my_github_username")
password_box = browser.find_element(By.ID, "password")
password_box.send_keys("my_github_password")
password_box.submit()
profile_link = browser.find_element(By.CLASS_NAME, "user-profile-link")
link_label = profile_link.get_attribute("innerHTML")
assert "my_github_username" in link_label
browser.quit()