justinlittman / fb-ad-archive-scraper

Scraper for Facebook's Archive of Ads with Political Content
MIT License
35 stars 11 forks source link

Unable to locate element: {"method":"name","selector":"login"} #8

Open jcwelty opened 6 years ago

jcwelty commented 6 years ago

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"name","selector":"login"} (Session info: headless chrome=69.0.3497.100) (Driver info: chromedriver=2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 10.0.17134 x86_64)

Anyone else seeing this? Selenuim can't seem to find the login button. Started a couple days ago.

Full error:

Traceback (most recent call last): File "scraper.py", line 343, in headless=not args.headed, wait=args.wait) File "scraper.py", line 171, in main driver.find_element_by_name('login').click() File "C:\Users\jackw\AppData\Local\conda\conda\envs\py36fbads\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 489, in find_element_by_name return self.find_element(by=By.NAME, value=name) File "C:\Users\jackw\AppData\Local\conda\conda\envs\py36fbads\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 957, in find_element 'value': value})['value'] File "C:\Users\jackw\AppData\Local\conda\conda\envs\py36fbads\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 314, in execute self.error_handler.check_response(response) File "C:\Users\jackw\AppData\Local\conda\conda\envs\py36fbads\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":"name","selector":"login"} (Session info: headless chrome=69.0.3497.100) (Driver info: chromedriver=2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 10.0.17134 x86_64)

marceloalvesuff commented 6 years ago

I am also receiving this error message. Perhaphs Facebook changed the login fields

krwarner commented 5 years ago

If you remove all lines from scraper.py that reference the email or password, then it works. Then in the command line remove the calls to your email and password, but leave everything else. However, if you are like me, you then might run into an entirely different problem like this:

Finding and fixing top navs Finding ad class Processing 30 ads on page 1 Ad 1 Ad 2 Traceback (most recent call last): File "scraper.py", line 321, in headless=not args.headed, wait=args.wait) File "scraper.py", line 195, in main process_ad_divs(new_ad_divs, len(processed_ad_divs), driver, dirname, ad_limit, wait=wait)) File "scraper.py", line 76, in process_ad_divs ad_div.find_element_by_partial_link_text('See Ad Performance').click() File "C:\Users\Kenny\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click self._execute(Command.CLICK_ELEMENT) File "C:\Users\Kenny\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webelement.py", line 628, in _execute return self._parent.execute(command, params) File "C:\Users\Kenny\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 314, in execute self.error_handler.check_response(response) File "C:\Users\Kenny\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: Element ... is not clickable at point (614, 486). Other element would receive the click:

(Session info: chrome=69.0.3497.100) (Driver info: chromedriver=2.43.600210 (68dcf5eebde37173d4027fa8635e332711d2874a),platform=Windows NT 10.0.17134 x86_64)