I was trying to get into introductory web scraping with selenium
in Python, but I keep getting this mysterious error when I start up a basic Chrome instance:
LookupError: unknown encoding: idna
when using the following code:
from selenium import webdriver
url = 'http://www.webscrapingfordatascience.com/complexjavascript/'
driver = webdriver.Chrome()
driver.get(url)
I installed Chrome's necessary webdriver with brew cask install chromedriver
.
I tried searching around the web for potential solutions, but it does not seem anyone else has asked this in relation to running selenium with Python, and this bug is also rather vague.
Edit
The question here's answer of doing an import encodings.idna
gives me the new error of Module not found in Python.
In addition, my system is a mbp with Mac OS 10.11, Python is 3.7.2 (Clang 8.0.0), and pip is =19.0.3
.
echo $PATH
gives me the following output:
/Users/Michael/miniconda3/bin:/Users/Michael/intelpython3/bin:/Users/Michael/miniconda3/bin:/Users/Michael/miniconda3/bin:/opt/local/bin:/opt/local/sbin:/usr/local/sbin:/Users/Michael/anaconda3/lib/python3.6/site-packages:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Users/Michael/anaconda3/bin:/Users/Michael/anaconda3/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/MacGPG2/bin:/Library/TeX/texbin’:/Users/Michael/intelpython3/bin