hello anyone can help me in selenium python script. I am getting error

2023-07-20T06:21:57.447Z ACTOR: Pulling Docker image from repository. 2023-07-20T06:21:57.588Z ACTOR: Creating Docker container. 2023-07-20T06:21:57.732Z ACTOR: Starting Docker container. 2023-07-20T06:21:58.502Z Starting X virtual framebuffer using: Xvfb :99 -ac -screen 0 1920x1080x24+32 -nolisten tcp 2023-07-20T06:21:58.505Z Executing main command 2023-07-20T06:21:59.570Z INFO Initializing actor... 2023-07-20T06:21:59.571Z INFO System info ({"apify_sdk_version": "1.1.1", "apify_client_version": "1.2.2", "python_version": "3.11.3", "os": "linux"}) 2023-07-20T06:21:59.584Z ERROR Actor failed with an exception 2023-07-20T06:21:59.585Z Traceback (most recent call last): 2023-07-20T06:21:59.586Z File "/usr/src/app/src/main.py", line 55, in main 2023-07-20T06:21:59.587Z actor_input = await Actor.get_input() or {} 2023-07-20T06:21:59.587Z ^^^^^^^^^^^^^^^^^^^^^^^ 2023-07-20T06:21:59.588Z File "/opt/venv/lib/python3.11/site-packages/apify/actor.py", line 620, in get_input 2023-07-20T06:21:59.589Z return await cls._get_default_instance().get_input() 2023-07-20T06:21:59.590Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-07-20T06:21:59.590Z File "/opt/venv/lib/python3.11/site-packages/apify/actor.py", line 623, in _get_input_internal 2023-07-20T06:21:59.591Z self._raise_if_not_initialized() 2023-07-20T06:21:59.592Z File "/opt/venv/lib/python3.11/site-packages/apify/actor.py", line 199, in _raise_if_not_initialized 2023-07-20T06:21:59.592Z raise RuntimeError('The actor was not initialized!') 2023-07-20T06:21:59.593Z RuntimeError: The actor was not initialized! 2023-07-20T06:21:59.593Z INFO Exiting actor ({"exit_code": 91})
1 Reply
noble-gold
noble-gold2y ago
Hey @moska, it seems you are not initializing the Actor. You can either use the init and exit Actor methods or alternatively, you can use the context manager. https://docs.apify.com/sdk/python/docs/concepts/actor-lifecycle

Did you find this page helpful?