Open omar44g opened 3 years ago
In this section here
# Login Facebook chrome_options = webdriver.ChromeOptions() prefs = {"profile.default_content_setting_values.notifications" : 2} chrome_options.add_experimental_option("prefs",prefs) driver = webdriver.Chrome(chrome_options=chrome_options) driver.get('https://www.facebook.com') emailelement = driver.find_element(By.XPATH,'//*[@id="email"]') emailelement.send_keys(account) passelement = driver.find_element(By.XPATH,'//*[@id="pass"]') passelement.send_keys(password) loginelement = driver.find_element(By.XPATH,'//*[@id="loginbutton"]') loginelement.click()
loginelement = driver.find_element(By.XPATH,'//*[@id="loginbutton"]') the id always changes on Facebook and you should change it to the following:
loginelement = driver.find_element(By.XPATH,'//*[@id="loginbutton"]')
# Login Facebook chrome_options = webdriver.ChromeOptions() prefs = {"profile.default_content_setting_values.notifications" : 2} chrome_options.add_experimental_option("prefs",prefs) driver = webdriver.Chrome(chrome_options=chrome_options) driver.get('https://www.facebook.com') emailelement = driver.find_element(By.XPATH,'//*[@id="email"]') emailelement.send_keys(account) passelement = driver.find_element(By.XPATH,'//*[@id="pass"]') passelement.send_keys(password) loginelement = driver.find_element(By.XPATH,'//*[@name="login"]') loginelement.click()
In this section here
loginelement = driver.find_element(By.XPATH,'//*[@id="loginbutton"]')
the id always changes on Facebook and you should change it to the following: