Error logging into facebook in python selenium.

Joined
Jan 9, 2023
Messages
2
Reaction score
0
Python:
from facebookUserInfo import username, password
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
import time

class Facebook:
    
    def __init__(self,username,password):
        self.browser = webdriver.Chrome()
        self.username = username
        self.password = password
        time.sleep(1)

    def singIn(self):
        self.browser.get('https://www.facebook.com/login/')
        time.sleep(4)

        usernameInput = self.browser.find_element(By.XPATH,'//*[@id="email"]')
        passwordInput = self.browser.find_element(By.XPATH,'//*[@id="pass"]')


        usernameInput.send_keys(self.username)
        passwordInput.send_keys(self.password)
        passwordInput.send_keys(Keys.ENTER)
        time.sleep(5)


fbook = Facebook(username, password)
fbook.singIn()
Code:

erorr: [16144:16492:0109/090357.639:ERROR:device_event_log_impl.cc(215)] [09:03:57.638] Bluetooth: bluetooth_adapter_winrt.cc:1074 Getting Default Adapter failed.
Thanks in advance for your help.
 
Last edited:
Joined
Jan 8, 2023
Messages
27
Reaction score
2
The error message "Getting Default Adapter failed" is related to the system's Bluetooth and can be ignored. To troubleshoot issues with the script not logging in to Facebook, check that the correct username and password are being used and that the XPATH selectors for the email and password fields on the login page are correct. You can verify this by inspecting the page and checking the element's XPATH.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top