1 下载phantoms
2 把phantoms添加进环境变量path
3 Pycharm安装外部库selenium
4 Pycharn中运行下列代码即可
from selenium import webdriver import time from selenium.webdriver.common.keys import Keys driver = webdriver.PhantomJS(executable_path=r'E:\phantomjs-2.1.1-windows\bin\phantomjs.exe') driver.get("https://mail.163.com/") print("Title: {0}".format(driver.title))