hikaruAi / FacebookBot

A facebook bot to scrap, post, spam and more without the facebook API
Apache License 2.0
359 stars 117 forks source link

Can't log in #3

Open pablodalma93 opened 7 years ago

pablodalma93 commented 7 years ago

I'm trying FacebookWebBot from Python 3.4 with Selenium and PhantomJS installed. It just returns the message "Fail to login", checked the username and password are correct. Any ideas what could it be ? . I'm trying to check the error code in self.error_handler.dict and it returns empty dictionary

saade commented 7 years ago

Same here

saade commented 7 years ago

@pablodalma93

Oh, i see.

Facebook now has the feature "one click login", which added a new page after login page instead of feed page.

just change the login def:

between: pass_element.send_keys(Keys.ENTER) and try:

        if self.find_element_by_class_name("bi"):
            self.find_element_by_class_name("bp").click();
paladini commented 7 years ago

Hey @SaadeMotion , it would be awesome if you can provide a pull request with the fix for this issue! :)

saade commented 7 years ago

Sure!

saade commented 7 years ago

Done!

paladini commented 7 years ago

Thank you!

gptty commented 6 years ago

Doesn't work for me... I guess login through headless browsers is blocked by Facebook somehow, since I also had no luck with login through headless ChromeDriver.

OpSky commented 6 years ago

Same for me, any advice ?

gptty commented 6 years ago

@OpSky No good advice… I end up writing my own Selenium script. At least it works.

wfranus commented 6 years ago

adding this line: time.sleep(3) after pass_element.send_keys(Keys.ENTER) did job for me. Remember to add import time at the beginning of the script