jcontini / facebook-photos-download

Download your tagged photos from Facebook
MIT License
38 stars 24 forks source link

Error, loginbutton not found #15

Open kelusk opened 3 years ago

kelusk commented 3 years ago

Dears, I'm trying to use this project but something is going wrong. Probably the loginbutton id is changed?

Opening Browser... get-tagged-photos.py:19: DeprecationWarning: use options instead of chrome_options driver = webdriver.Chrome(chrome_options=wd_options)

DevTools listening on ws://127.0.0.1:54967/devtools/browser/4b32f865-004c-4501-bdfc-9647773e2e2b Logging In... Traceback (most recent call last): File "get-tagged-photos.py", line 171, in driver = start_session(args.u,args.p) File "get-tagged-photos.py", line 28, in start_session driver.find_element_by_id("loginbutton").click() File "C:\Users\mschiavi\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 360, in find_element_by_id return self.findelement(by=By.ID, value=id) File "C:\Users\mschiavi\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 978, in find_element 'value': value})['value'] File "C:\Users\mschiavi\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Users\mschiavi\Anaconda3\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="loginbutton"]"} (Session info: chrome=88.0.4324.150)

eidorb commented 3 years ago

It appears a different button id is generated for each request.

Change this line to the following:

        driver.find_element_by_css_selector('button[name=login]').click()

That will get you past the login page, only to face another error.

eidorb commented 3 years ago

I forked the repo thinking I'd make some minor changes, but ended up doing a full rewrite.

https://github.com/eidorb/photos-of-me

shohamjac commented 3 years ago

I used your new fork and found you missed the capital letters in "View Full Size".

Except for this, it worked great.

eidorb commented 3 years ago

Thanks for the feedback. I think that issue could be solved with case-insensitive XPATH matching.