antonengelhardt / kicktipp-bot

A bot which can submit tips for a Kicktipp competition based on quotes.
MIT License
14 stars 5 forks source link

TypeError: object of type 'NoneType' has no len() #1

Closed Shazgul closed 1 year ago

Shazgul commented 1 year ago
PS E:\Kicktipp> python .\main.py local
20.01.23 16:00: The script will execute now!

E:\Kicktipp\main.py:33: DeprecationWarning: executable_path has been deprecated, please pass in a Service object
  driver = webdriver.Chrome(CHROMEDRIVER_PATH)  # for local

DevTools listening on ws://127.0.0.1:7355/devtools/browser/726071d9-a230-4496-a6e4-b85db8a040d6
Traceback (most recent call last):
  File "E:\Kicktipp\main.py", line 222, in <module>
    execute()
  File "E:\Kicktipp\main.py", line 42, in execute
    driver.find_element(by=By.ID, value="kennung").send_keys(EMAIL)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webelement.py", line 234, in send_keys
    Command.SEND_KEYS_TO_ELEMENT, {"text": "".join(keys_to_typing(value)), "value": keys_to_typing(value)}
                                                   ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\common\utils.py", line 148, in keys_to_typing
    for i in range(len(val)):
                   ^^^^^^^^
TypeError: object of type 'NoneType' has no len()
antonengelhardt commented 1 year ago

Hey @Shazgul, it seems that you tried running the Bot on Windows. Can you tell me if you save the chromedriver opened? Maybe that is the problem here. You might need to change the CHROMEDRIVER_PATH to the path of the chromedriver executable. Then a new "automated" Chrome window appears

You can also run the bot as a docker container. See the Easy Instal Section in README.md

Another option would be, to run the bot in headless mode: python main.py headless

I hope this helps.