csaftoiu / yahoo-groups-backup

A python script to backup the contents of private Yahoo! groups.
The Unlicense
37 stars 18 forks source link

"AttributeError: 'YahooBackupScraper' object has no attribute 'br'" when running with Firefox driver #49

Open logological opened 4 years ago

logological commented 4 years ago

Running yahoo-groups-backup.py scrape_files $GROUPNAME fails with the following message:

Traceback (most recent call last):
  File "./yahoo-groups-backup.py", line 129, in <module>
    main()
  File "./yahoo-groups-backup.py", line 125, in main
    arguments, cfg_args)
  File "./yahoo-groups-backup.py", line 103, in invoke_subcommand
    return module.command(args)
  File "/home/psy/tmp/yahoo-groups-backup/yahoo_groups_backup/subcommands/scrape_files.py", line 26, in command
    password=arguments['--password'])
  File "/home/psy/tmp/yahoo-groups-backup/yahoo_groups_backup/scraper.py", line 29, in __init__
    self.br = splinter.Browser(driver)
  File "/home/psy/tmp/yahoo-groups-backup/venv/lib/python3.6/site-packages/splinter/browser.py", line 63, in Browser
    return driver(*args, **kwargs)
  File "/home/psy/tmp/yahoo-groups-backup/venv/lib/python3.6/site-packages/splinter/driver/webdriver/firefox.py", line 39, in __init__
    self.driver = Firefox(firefox_profile)
  File "/home/psy/tmp/yahoo-groups-backup/venv/lib/python3.6/site-packages/selenium/webdriver/firefox/webdriver.py", line 81, in __init__
    self.binary, timeout)
  File "/home/psy/tmp/yahoo-groups-backup/venv/lib/python3.6/site-packages/selenium/webdriver/firefox/extension_connection.py", line 51, in __init__
    self.binary.launch_browser(self.profile, timeout=timeout)
  File "/home/psy/tmp/yahoo-groups-backup/venv/lib/python3.6/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser
    self._wait_until_connectable(timeout=timeout)
  File "/home/psy/tmp/yahoo-groups-backup/venv/lib/python3.6/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 106, in _wait_until_connectable
    % (self.profile.path))
selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: /tmp/tmpt8sz3hub If you specified a log_file in the FirefoxBinary constructor, check it for details.

Exception ignored in: <bound method YahooBackupScraper.__del__ of <yahoo_groups_backup.scraper.YahooBackupScraper object at 0x7f030b767cc0>>
Traceback (most recent call last):
  File "/home/psy/tmp/yahoo-groups-backup/yahoo_groups_backup/scraper.py", line 32, in __del__
    self.br.quit()
AttributeError: 'YahooBackupScraper' object has no attribute 'br'

This particular problem does not occur when using the chrome driver instead, though this driver fails for other reasons (for which I will file a separate report).

ashpland commented 4 years ago

pip install -U selenium got me past this, though now something is failing in Firefox on the login page. (Still, a step forward!)

Stackoverflow where I found this.

hrenfroe commented 4 years ago

I can't find the citation now, but FF 53 changed a default setting so that it uses the JSON viewer by default, which confuses Selenium. I tried to initialize the temporary profile with the setting to disable it, but gave up and used Chromedriver instead.

ejheil commented 4 years ago

This is exactly where I'm at re: firefox failures

Dumb question, but possibly useful to people who end up here: how do I make selenium use the chrome driver instead?

OS: MacOS Mojave

hrenfroe commented 4 years ago

You want ./yahoo-groups-backup.py scrape_messages --driver chrome your_group_name_here. You are likely to run into issues detecting the login page after that, and I recommend my fork to deal with that.

ejheil commented 4 years ago

Thanks! Hope to get your fork working.