Skip to content
← Back to Community
How can I run selenium 247 ?
Profile icon
ChandanHans

I have two files 'main.py' and 'keep_alive.py'. I am trying to run selenium in the main file and in other threads I am trying to run keep_alive.py which creates a flask webserver so that I can ping the keep_alive server with uptimerobot. So that both the file will run in repl.it servers 24/7. But when selenium starts the flask webserver stops running and ti shows an error

handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread

Voters
Profile icon
ChandanHans
Profile icon
chethansai
Profile icon
Kek1000
Comments
hotnewtop
Profile icon
chethansai

Does anyone know a solution to this?

Profile icon
ChandanHans

@chethansai
I have solved the problem.

Profile icon
prasadw9

@ChandanHans oh great! Can you please explain how?

Profile icon
ChandanHans

@chethansai
I have created flask server in main.py and run selenium task in Task.py. And then I called flask app and Task() in main.py.
you can check it here
https://replit.com/@ChandanHans/selinium247#main.py