运行此selenium脚本时出现错误。请建议可以做些什么来解决这个问题: 脚本:ModuleNotFoundError:没有名为'selenium'的模块
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import re
import csv
import time
driver = webdriver.chrome("<webdriver path>")
driver.get("https://www.google.com/")
driver.find_element_by_xpath('//*[@title="Search"]')
send_keys('abc')
driver.find_element_by_xpath('//*[@class="sbico _wtf _Qtf"]').click()
time.sleep(5)
driver.find_element_by_xpath('//[@id="rso"]/div[1]/div/div[1]/div/div/h3/a')
print(var)
错误: 回溯(最近通话最后一个): 文件 “C:/Users/admin/Desktop/test2.py”,2号线,在 来自selenium import webdriver ModuleNotFoundError:没有名为'selenium'的模块
我在Win 7 Professional 32位上安装了Python 3.6。我有Selenium Standalone Server版本3.4.0(link)
你安装了硒吗?像pip安装硒? – Exprator
我有Selenium Standalone Server版本3.4.0(链接)。我也安装了ChromeDriver 2.29。我需要安装其他东西吗? –
问题是硒文件没有被加载。去cmd并使用pip安装硒。 – Exprator