使用“ dr = webdriver.phantomjs()”时,如何解决“ TypeError:'模块'对象不可调用”的问题?

时间:2019-06-23 12:10:46

标签: python

我该如何解决这个问题?

C:\ WINDOWS \ system32> phantomjs phantomjs> ^ C

>>> from selenium import webdriver
>>> dr=webdriver.phantomjs()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable

>>> driver =
webdriver.phantomjs(executable_path='D:\soft\foldsoft\phantomjs\phantomjs-2.1.1-windows\bin\phantojs')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
>>>

1 个答案:

答案 0 :(得分:0)

您需要大写PhantomJS

dr= webdriver.PhantomJS()