charlesbel / Microsoft-Rewards-Farmer

A simple bot that uses selenium to farm Microsoft Rewards written in Python
MIT License
1.02k stars 272 forks source link

[BUG] Stuck at Logging in - not filing in MS login info... #449

Open shopbuy11 opened 8 months ago

shopbuy11 commented 8 months ago

Before submitting a bug report...

Title

Describe the bug

Starting about a week ago, the bot no longer works for me. In -v mode, I can see the Chrome browser launching the MS Login page, but the bot fails to fill in the account information. Prior to this, the bot had worked for me for quite a while. Any idea what broke? I tried the Klept0 fork, but it's doing the same exact thing...

Copy and paste your error

image

Screenshots

image

Value of dashboard variable

https://gist.github.com/shopbuy11/a8417970aaa4a3a98621ef9afdb7602f

xnuit commented 8 months ago

I've been having the same problem since yesterday. I tried updating and verified my accounts.json file

SteveLLF commented 8 months ago

I guess it is this part in login.py doesn't work, it couldn't find MeePortal or loginHeader

def login(self):
    logging.info("[LOGIN] " + "Logging-in...")
    self.webdriver.get("https://login.live.com/")
    alreadyLoggedIn = False
    print("alreadyLoggedIn step")
    while True:
        try:
            self.utils.waitUntilVisible(
                By.CSS_SELECTOR, 'html[data-role-name="MeePortal"]', 10
            )
            alreadyLoggedIn = True
            break
        except Exception:  # pylint: disable=broad-except
            try:
                self.utils.waitUntilVisible(By.ID, "loginHeader", 10)
                break
            except Exception:  # pylint: disable=broad-except
                if self.utils.tryDismissAllMessages():
                    continue
SteveLLF commented 8 months ago

it's just stuck in this while loop in my testing image

iDarkSnow commented 8 months ago

This error only happens on one of the two accounts i'm using since one is already logged in

shopbuy11 commented 8 months ago

Ok, so does anyone know how to solve this? What should the login.py look for instead of LoginHeader?

SteveLLF commented 8 months ago

This error only happens on one of the two accounts i'm using since one is already logged in

not quite right as i only use one account

VforVolcano commented 8 months ago

workaround:

It is half a solution but it works for me

Lectoid commented 8 months ago

workaround:

* use the -v argument when opening the login page.

* open a new tab and log in manually and close the session.

* It is recommended to kill the app with  taskkill /F /IM Chrome.exe.

* After that you can run the script normally without argument (if you clear the session you have to log back in)

It is half a solution but it works for me

This worked for me, to save a step or two, I opened a new tab and logged in, then on the first tab I just refreshed the page and it took off from there.

Thank you @VforVolcano

shopbuy11 commented 8 months ago

Thanks for the workaround, but it's not working for me. Plus I do have more than 1 account, :)

Does anyone have a better, more permanent fix? TIA!

harukodi commented 8 months ago

Currently am developing my own solution on docker with selenium hub thus you can run this without interaction, am currently having problems with phone searches. tho but the whole Search function for pc searches is now in a docker container, some code is from this project but i have mainly done my own, and am thinking of releasing my code. Sadly the code i can give does not work with docker, but it will try to login if that do not work it just skips it if you run it on your pc with your account already logged in. it will search sadly you will need a spare computer for the version that i can release as it uses selenium and the browser is not headless.

harukodi commented 8 months ago

Reference

I have succeeded to rotate the user agent for mobiles when not using the selenium hub in docker that's why headless won't work due to limitations in selenium remote driver

shopbuy11 commented 7 months ago

Thanks for working on another solution. I look forward to it when you think it's ready.

harukodi commented 7 months ago

Thanks for working on another solution. I look forward to it when you think it's ready.

Sure i will upload it soon still have to test it, it will not be the docker version as it's to much overhead to set up you will need a bash script to restart the containers every night and be familiar with crontab/cron in linux for the containers to restart every night this is done so that the mobile user agent will rotate everyday due to limitations in the selenium remote driver i have fixed it in this fuckery of a way so! would people like to run the script on a schedule or just run it as fast as you run the script?

maephisto666 commented 7 months ago

This PR should fix this

https://github.com/charlesbel/Microsoft-Rewards-Farmer/pull/451/files

shopbuy11 commented 6 months ago

Thank you so much. Sorry for the slow reply as I have been out of the country. But your fix definitely is working!

harukodi commented 6 months ago

Here is mine i may also upload the docker version of this one so you can run this script in headless mode within a docker container.

The documentation I have written is probably pretty bad xD, but you can try this!

https://codeberg.org/xia1997x/axb234-45-b1-ms-farmer-v3-2

cal4 commented 6 months ago

Another fix here in my fork #450

DealsBeam commented 2 months ago

So which fix should I use?