aapatre / Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE

Do you want to LEARN NEW STUFF for FREE? Don't worry, with the power of web-scraping and automation, this script will find the necessary Udemy coupons & enroll you for PAID UDEMY COURSES, ABSOLUTELY FREE!
GNU General Public License v3.0
3.17k stars 553 forks source link

[BUG] Selecting Firefox as browser goes in error #227

Closed DarkSkull91 closed 3 years ago

DarkSkull91 commented 3 years ago

I've just tried choosing Firefox as browser and I get these errors:

Enabled debug logging
Loading existing settings

[WDM] - ====== WebDriver manager ======
[WDM] - Driver [/home/darkskull/.wdm/drivers/geckodriver/linux64/v0.29.0/geckodriver] found in cache
Closing browser
Traceback (most recent call last):
  File "udemy_enroller.py", line 4, in <module>
    main()
  File "/home/darkskull/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/udemy_enroller/cli.py", line 118, in main
    run(args.browser, tutorialbar_enabled, discudemy_enabled, args.max_pages)
  File "/home/darkskull/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/udemy_enroller/cli.py", line 57, in run
    redeem_courses(
  File "/home/darkskull/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/udemy_enroller/runner.py", line 95, in redeem_courses
    _redeem_courses(driver, settings, scrapers)
  File "/home/darkskull/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/udemy_enroller/runner.py", line 38, in _redeem_courses
    udemy_actions.login()  # login once outside while loop
  File "/home/darkskull/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/udemy_enroller/udemy.py", line 51, in login
    email_element.send_keys(self.settings.email)
  File "/home/darkskull/anaconda3/envs/py8x/lib/python3.8/site-packages/selenium/webdriver/remote/webelement.py", line 477, in send_keys
    self._execute(Command.SEND_KEYS_TO_ELEMENT,
  File "/home/darkskull/anaconda3/envs/py8x/lib/python3.8/site-packages/selenium/webdriver/remote/webelement.py", line 633, in _execute
    return self._parent.execute(command, params)
  File "/home/darkskull/anaconda3/envs/py8x/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/home/darkskull/anaconda3/envs/py8x/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.StaleElementReferenceException: Message: The element reference of <input id="id_email" class="emailinput form-control" name="email" type="email"> is stale; either the element is no longer attached to the DOM, it is not in the current frame context, or the document has been refreshed

I'm running on a Kali Linux machine, with Chrome is working well.

fakeid30 commented 3 years ago

@DarkSkull91 How did you run the app? Is the email and username up-to-date?

Can you share a gif of this error happening? Preferably with a dummy account where you can show the content of the settings.yml as well?

I can't reproduce this.

As a last resort, try installing the firefox webdriver manually.

DarkSkull91 commented 3 years ago

Yes, it's all up-to-date because with Chrome I haven't this problem. I'll try to install firefox webdriver manually.

fakeid30 commented 3 years ago

@DarkSkull91 let me know the update of this.

creatingcraziness commented 3 years ago

I'm having a similar issue. I tried it on chrome, edge and firefox and as of 2 days ago none of them work. So for a bit of context my windows is not set to english is set to portuguese. All the web browsers i have installed are all in english but when i run the code the pages are opened to Portuguese. And it seems to mess with the code for some reason.

code2.txt

cullzie commented 3 years ago

This issue could also be related to the captcha #233 . Need to investigate it more

creatingcraziness commented 3 years ago

yeah when i tried on firefox it did time me out before i could finish the captcha. on the other browsers, it would just close before i could do anything and give me the errors i showed you

fakeid30 commented 3 years ago

@DarkSkull91 with new approach this will not be relevant. Closing.