csaftoiu / yahoo-groups-backup

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

Login Page not recognized #51

Closed jjaquinta closed 4 years ago

jjaquinta commented 4 years ago

The login page has changed and when it tries to click on "next" it instead clicks on an advertisement. I was able to fix this by changing process_login_page to the following:

    def _process_login_page(self):
        """Process the login page."""
        if not self.login_email or not self.password:
            raise ValueError("Detected private group! Login information is required")

        eprint("Processing the log-in page...")

        # email ...
        self.br.fill("username", self.login_email+Keys.RETURN)
        # Wait ...
        time.sleep(2)

        # password ...
        self.br.fill("password", self.password+Keys.RETURN)
        # Wait ...
        time.sleep(2)
jjaquinta commented 4 years ago

Oh, I also had to change is_login_page since, for me, the username entry is split from the password entry.

   def _is_login_page(self):
        html = self.br.html
        eprint("Detecting the log-in page...")
        # eprint(html)
        ret = "Enter your email" in html or "Sign in" in html
        eprint("Detected="+str(ret))
        return ret
nudomarinero commented 4 years ago

Thanks. These changes work for me (in a forked version of @hrenfroe - https://github.com/hrenfroe/yahoo-groups-backup). Provided that you quickly click the OK button in first dialog that appears, the script continues correctly.

chrisindallas commented 4 years ago

I tried these patches. My Chrome window pops up and goes away after a few seconds. I've tried it with and without --login= and --password= . I'm fine with typing in my login credentials, but I need more time. This evidently isn't the time.sleep() above, because I changed those to 30 seconds and no different. Any ideas?

hrenfroe commented 4 years ago

@chrisindallas Have you tried my fork at https://github.com/hrenfroe/yahoo-groups-backup ? I've implemented a solution to the issues with recognizing and autofilling the login pages, and I have it working without manual intervention. Check it out and feel free to open a separate issue there if you're still having trouble.

JustinCEO commented 4 years ago

hi @hrenfroe, i tried using your fork with the argument --driver=chrome (in order to deal with another error I had) and I'm getting the error message "ValueError: Detected private group! Login information is required." i edited the settings.yaml.template file with my account info. any ideas?

if i don't use --driver=chrome, firefox opens to a blank page and nothing happens, and i get the error message

selenium.common.exceptions.WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.

if i do use --driver=chrome, chromium at least gets to the yahoo login page :)

JustinCEO commented 4 years ago

oh wow, i figured it out, i forgot to remove "template" from the settings.yaml.template file name, haha

csaftoiu commented 4 years ago

@hrenfroe if you make a PR i'll merge it, using your version now to dump my private group :) works fine once i click the initial "OK"

hrenfroe commented 4 years ago

PR opened :+1:

csaftoiu commented 4 years ago

Resolved by https://github.com/csaftoiu/yahoo-groups-backup/pull/54