ninjemail icon indicating copy to clipboard operation
ninjemail copied to clipboard

issue with creating outlook accounts with chrome

Open nostorian opened this issue 1 year ago • 9 comments

hey there i am getting the following error when i execute my code while i am trying to create an outlook account: the error is down below, before that this is my code, any help would be appreciated:

from ninjemail.ninjemail import Ninjemail


ninja = Ninjemail(browser="chrome", captcha_keys={"capsolver": "key"}, proxy="http://myproxy",auto_proxy=True)

email, password =ninja.create_outlook_account()
print(f"Email: {email}")
print(f"Password: {password}")
DevTools listening on ws://127.0.0.1:57374/devtools/browser/ab19c750-9f1e-4667-bcbe-f68ebf9e8012
Traceback (most recent call last):
  File "c:\Users\Chiranjeevi\Documents\test\balls.py", line 6, in <module>
    email, password =ninja.create_outlook_account()
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Chiranjeevi\Documents\test\ninjemail\ninjemail\ninjemail_manager.py", line 183, in create_outlook_account
    return outlook.create_account(captcha_key,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Chiranjeevi\Documents\test\ninjemail\ninjemail\email_providers\outlook.py", line 62, in create_account
    capsolver_src = driver.find_element(By.XPATH, '/html/script[2]')
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chiranjeevi\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 741, in find_element
    return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chiranjeevi\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 347, in execute
    self.error_handler.check_response(response)
  File "C:\Users\Chiranjeevi\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 229, in check_response       
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/script[2]"}
  (Session info: chrome=124.0.6367.62); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Stacktrace:
        GetHandleVerifier [0x0030C113+48259]
        (No symbol) [0x0029CA41]
        (No symbol) [0x00190A17]
        (No symbol) [0x001D0BED]
        (No symbol) [0x001D0C9B]
        (No symbol) [0x0020BC12]
        (No symbol) [0x001F0DE4]
        (No symbol) [0x00209B9C]
        (No symbol) [0x001F0B36]
        (No symbol) [0x001C570D]
        (No symbol) [0x001C62CD]
        GetHandleVerifier [0x005C6533+2908323]
        GetHandleVerifier [0x00603B4B+3159739]
        GetHandleVerifier [0x003A505B+674763]
        GetHandleVerifier [0x003AB21C+699788]
        (No symbol) [0x002A6244]
        (No symbol) [0x002A2298]
        (No symbol) [0x002A242C]
        (No symbol) [0x00294BB0]
        BaseThreadInitThunk [0x76DE7BA9+25]
        RtlInitializeExceptionChain [0x7762BD2B+107]
        RtlClearBits [0x7762BCAF+191]
        (No symbol) [0x00000000]

PS C:\Users\Chiranjeevi\Documents\test> & C:/Users/Chiranjeevi/AppData/Local/Programs/Python/Python312/python.exe c:/Users/Chiranjeevi/Documents/test/balls.py

DevTools listening on ws://127.0.0.1:57397/devtools/browser/93ded471-43b6-41b5-8460-7c13234cd327
Traceback (most recent call last):
  File "c:\Users\Chiranjeevi\Documents\test\balls.py", line 6, in <module>
    email, password =ninja.create_outlook_account()
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Chiranjeevi\Documents\test\ninjemail\ninjemail\ninjemail_manager.py", line 183, in create_outlook_account
    return outlook.create_account(captcha_key,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Chiranjeevi\Documents\test\ninjemail\ninjemail\email_providers\outlook.py", line 62, in create_account
    capsolver_src = driver.find_element(By.XPATH, '/html/script[2]')
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chiranjeevi\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 741, in find_element
    return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chiranjeevi\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 347, in execute
    self.error_handler.check_response(response)
  File "C:\Users\Chiranjeevi\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 229, in check_response       
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/script[2]"}
  (Session info: chrome=124.0.6367.62); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Stacktrace:
        GetHandleVerifier [0x0030C113+48259]
        (No symbol) [0x0029CA41]
        (No symbol) [0x00190A17]
        (No symbol) [0x001D0BED]
        (No symbol) [0x001D0C9B]
        (No symbol) [0x0020BC12]
        (No symbol) [0x001F0DE4]
        (No symbol) [0x00209B9C]
        (No symbol) [0x001F0B36]
        (No symbol) [0x001C570D]
        (No symbol) [0x001C62CD]
        GetHandleVerifier [0x005C6533+2908323]
        GetHandleVerifier [0x00603B4B+3159739]
        GetHandleVerifier [0x003A505B+674763]
        GetHandleVerifier [0x003AB21C+699788]
        (No symbol) [0x002A6244]
        (No symbol) [0x002A2298]
        (No symbol) [0x002A242C]
        (No symbol) [0x00294BB0]
        BaseThreadInitThunk [0x76DE7BA9+25]
        RtlInitializeExceptionChain [0x7762BD2B+107]
        RtlClearBits [0x7762BCAF+191]
        (No symbol) [0x00000000]

nostorian avatar Apr 24 '24 23:04 nostorian

Hi, have you set up your captcha key and proxy?

david96182 avatar Apr 24 '24 23:04 david96182

Hi, have you set up your captcha key and proxy?

yea dont worry about that. i added the appropriate key and proxy required. censored for the sake of the post. yet got this error with the valid credentials

nostorian avatar Apr 25 '24 04:04 nostorian

yea dont worry about that. i added the appropriate key and proxy required. censored for the sake of the post. yet got this error with the valid credentials

I assumed that, but I had to ask. Well, in that case, I think it's because the proxy you are using is not good enough and does not support Google. Try testing it without a proxy.

david96182 avatar Apr 25 '24 04:04 david96182

yea dont worry about that. i added the appropriate key and proxy required. censored for the sake of the post. yet got this error with the valid credentials

I assumed that, but I had to ask. Well, in that case, I think it's because the proxy you are using is not good enough and does not support Google. Try testing it without a proxy.

tried without proxy got hit with this error:

DevTools listening on ws://127.0.0.1:64365/devtools/browser/febd42b7-48ee-4b4d-83c1-8e1ccc7ef038
Traceback (most recent call last):
  File "c:\Users\Chiranjeevi\Documents\test\balls.py", line 6, in <module>
    email, password =ninja.create_outlook_account()
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Chiranjeevi\Documents\test\ninjemail\ninjemail\ninjemail_manager.py", line 183, in create_outlook_account
    return outlook.create_account(captcha_key,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Chiranjeevi\Documents\test\ninjemail\ninjemail\email_providers\outlook.py", line 62, in create_account
    capsolver_src = driver.find_element(By.XPATH, '/html/script[2]')
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chiranjeevi\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 741, in find_element
    return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chiranjeevi\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 347, in execute
    self.error_handler.check_response(response)
  File "C:\Users\Chiranjeevi\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/script[2]"}
  (Session info: chrome=124.0.6367.63); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Stacktrace:
        GetHandleVerifier [0x00C8C113+48259]
        (No symbol) [0x00C1CA41]
        (No symbol) [0x00B10A17]
        (No symbol) [0x00B50BED]
        (No symbol) [0x00B50C9B]
        (No symbol) [0x00B8BC12]
        (No symbol) [0x00B70DE4]
        (No symbol) [0x00B89B9C]
        (No symbol) [0x00B70B36]
        (No symbol) [0x00B4570D]
        (No symbol) [0x00B462CD]
        GetHandleVerifier [0x00F46533+2908323]
        GetHandleVerifier [0x00F83B4B+3159739]
        GetHandleVerifier [0x00D2505B+674763]
        GetHandleVerifier [0x00D2B21C+699788]
        (No symbol) [0x00C26244]
        (No symbol) [0x00C22298]
        (No symbol) [0x00C2242C]
        (No symbol) [0x00C14BB0]
        BaseThreadInitThunk [0x761A7BA9+25]
        RtlInitializeExceptionChain [0x77CABD2B+107]
        RtlClearBits [0x77CABCAF+191]

nostorian avatar Apr 27 '24 12:04 nostorian

Please try using undetected-chrome and check if the error persists.

david96182 avatar Apr 29 '24 13:04 david96182

Have you tried using undetected-chrome? Also, with the latest commits, I think the issue must be resolved. I changed the way the extension is loaded for Chrome and undetected-chrome. Now, it does not require opening any page, and the API key is added directly to the config.js of the extension. Please let me know.

david96182 avatar May 03 '24 15:05 david96182

alright will do so and keep you updated

nostorian avatar May 03 '24 17:05 nostorian

Have you tried using undetected-chrome? Also, with the latest commits, I think the issue must be resolved. I changed the way the extension is loaded for Chrome and undetected-chrome. Now, it does not require opening any page, and the API key is added directly to the config.js of the extension. Please let me know.

got this error below this time. heres the code below:

from ninjemail.ninjemail import Ninjemail

ninja = Ninjemail(browser="undetected-chrome", captcha_keys={"capsolver": "mykey"},auto_proxy=True)


if __name__ == "__main__":
    email, password =ninja.create_outlook_account()
    print(f"Email: {email}")
    print(f"Password: {password}")

Traceback (most recent call last):
  File "c:\Users\Chiranjeevi\Documents\test\balls.py", line 8, in <module>
    email, password =ninja.create_outlook_account()
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Chiranjeevi\Documents\test\ninjemail\ninjemail\ninjemail_manager.py", line 183, in create_outlook_account
    return outlook.create_account(driver, 
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Chiranjeevi\Documents\test\ninjemail\ninjemail\email_providers\outlook.py", line 46, in create_account
    email_input = WebDriverWait(driver, WAIT).until(EC.presence_of_element_located((By.ID, 'liveSwitch')))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chiranjeevi\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\support\wait.py", line 105, in until      
    raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
Stacktrace:
        GetHandleVerifier [0x00EBC113+48259]
        (No symbol) [0x00E4CA41]
        (No symbol) [0x00D40A17]
        (No symbol) [0x00D80BED]
        (No symbol) [0x00D80C9B]
        (No symbol) [0x00DBBC12]
        (No symbol) [0x00DA0DE4]
        (No symbol) [0x00DB9B9C]
        (No symbol) [0x00DA0B36]
        (No symbol) [0x00D7570D]
        (No symbol) [0x00D762CD]
        GetHandleVerifier [0x01176533+2908323]
        GetHandleVerifier [0x011B3B4B+3159739]
        GetHandleVerifier [0x00F5505B+674763]
        GetHandleVerifier [0x00F5B21C+699788]
        (No symbol) [0x00E56244]
        (No symbol) [0x00E52298]
        (No symbol) [0x00E5242C]
        (No symbol) [0x00E44BB0]
        BaseThreadInitThunk [0x77227BA9+25]
        RtlInitializeExceptionChain [0x7782BD2B+107]
        RtlClearBits [0x7782BCAF+191]

nostorian avatar May 04 '24 16:05 nostorian

I just tested it, and I did not encounter that error. I am not sure if it could be related to proxies. I noticed you are using the auto-proxy option. Could you try testing it without that option activated and using your own proxies?

david96182 avatar May 06 '24 15:05 david96182

@fw-real Turn off the --headless option in utils/webdriver_utils.py, wait for script bug and then inspect the html page. I think you have some error page because of proxy like wrong cert.

sndmndss avatar May 07 '24 09:05 sndmndss

utils/webdriver_utils.py, wait for script bug and then inspect the html page. I think you have some error page because of proxy like wrong cert.

i see aight i wil ltry without the proxies

nostorian avatar May 07 '24 20:05 nostorian

@fw-real Turn off the --headless option in utils/webdriver_utils.py, wait for script bug and then inspect the html page. I think you have some error page because of proxy like wrong cert.

aight thank you will give that a shot

nostorian avatar May 07 '24 20:05 nostorian

save error,

yulong314 avatar May 26 '24 07:05 yulong314