godmaster007 / Microsoft-Rewards-Bot

Microsoft Rewards (Bing Rewards) Bot - automated selenium python bot
7 stars 6 forks source link

Mobile search failing #3

Open godmaster007 opened 4 years ago

godmaster007 commented 4 years ago

Script keeps failing to complete mobile search for some of the accounts each day. I'm not sure how to troubleshoot the script properly, but I think the problem is caused by admin privileges. I think when the Windows "Task Scheduler" run's the script while it's not logged into my main account one of the apps fails to execute because it was installed for my specific user?

ZeroCool940711 commented 4 years ago

@godmaster007 you can check the logs folder and see if the bot has there something that can help you figure out why the mobile searches are failing for you. Today I noticed the mobile searches were also failing so I decided to look at the logs, it seems that in my case it is because Bing asks to know the location from where the bot is running and then it doesn't properly handle the alert that Bing shows which causes a WebDriverException error and that interrupts the execution for the mobile search part, maybe it's the same for you or maybe its something different, here is the error I'm getting and of course I'll be hiding sensitive information like my email:

2020-09-07 17:38:47,292 :: INFO :: root :: -------------------------MOBILE-------------------------
2020-09-07 17:38:50,451 :: INFO :: root :: Logging in xxxxxxxxxxxxxxxx@xxxxxx.com...
2020-09-07 17:39:35,704 :: INFO :: root :: Number of open offers: 1
2020-09-07 17:39:49,388 :: INFO :: root :: Mobile App Task not found
2020-09-07 17:39:50,396 :: INFO :: root :: WebDriverException while executing mobile portion
Traceback (most recent call last):
  File "D:\ZeroCool\Programs\Bot\Bing\Microsoft-Rewards-Bot\ms_rewards.py", line 917, in <module>
    browser.get(BING_SEARCH_URL)
  File "D:\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 333, in get
    self.execute(Command.GET, {'url': url})
  File "D:\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "D:\Python\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 241, in check_response
    raise exception_class(message, screen, stacktrace, alert_text)
selenium.common.exceptions.UnexpectedAlertPresentException: Alert Text: None
Message: unexpected alert open: {Alert text : Want more relevant search results? Allow Bing to access your location. Click 'Allow' on the next prompt.}
  (Session info: headless chrome=85.0.4183.83)
  (Driver info: chromedriver=85.0.4183.87 (cd6713ebf92fa1cacc0f1a598df280093af0c5d7-refs/branch-heads/4183@{#1689}),platform=Windows NT 10.0.19041 x86_64)