Message: ‘geckodriver’ executable needs to be in PATH.

from selenium import webdriver
driver = webdriver.Firefox(executable_path=r'your\path\geckodriver.exe')
driver.get('http://inventwithpython.com')

Here is what the above code is Doing:
1. It’s creating a webdriver object. This object is like a web browser.
2. It’s telling the webdriver object to open the URL ‘http://inventwithpython.com’.
3. It’s waiting for you to examine the page.
4. It’s closing the webdriver object.