OS: Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-1066-aws x86_64)
Selenium Version: selenium==3.6.0
Browser: Mozilla Firefox 63.0
Geckodriver version : geckodr
I fixed the issue by updating the selenium python package and using the latest geckodriver.
Thanks @fzbd for all your help.
Additional context -
Refer to the compatibility chart here - https://firefox-source-docs.mozilla.org/testing/geckodriver/Support.html#supported-platforms
update selenium :
pip install -U selenium
update geckodriver (choose the correct version for your needs based on the above compatibility chart)
Check the versions for all components -
firefox -v
geckodriver -V
pip freeze | grep selenium