In Al Sweigart’s book, there’s a section on working with selenium Module. It drove me nuts for a bit.
He said to enter the following into the interactive shell:I did as told and got the below error as I hit enter after browser = webdriver.Firefox():
It took me quite some time to figure out how to get this working but I got it and I am absolutely thrilled. So here’s what I did –
- Installed Homebrew by copying and pasting the following into Terminal:
- Typed brew install geckodriver into Terminal once Homebrew was successfully installed and few seconds later, (yay!) got gecko (really hate geckos) on my laptop:
- I then changed the script to the following on the interactive shell:At this point, there wasn’t any error like before and Firefox launched itself.
- I continued with the rest of the script:The webpage then loads on Firefox automatically!
This wasn’t an easy one to figure out as most solutions I found online were for Window users and there were million and one different ways to do this and I finally found one that worked for me after a day .
I hope this post is helpful for any Mac users out there facing the same issue with selenium Module.