TypeError module object is not callable

tags: unit test

driver = webdriver.chrome() TypeError: ‘module’ object is not callable

When I was building a unit test framework, I reported this error after running the code.

// code show as below:
import unittest
from selenium import webdriver
import time
import unittest
from ddt import ddt

class forTest2(unittest.TestCase):
    def test1(self):
        driver = webdriver.chrome()
        driver.get("http://www.baidu.com")
        driver.find_element_by_id('kw').send_keys("Virtual Bamboo")
        driver.find_element_by_id("su").click()

    if __name__ == '__main__':
        unittest.main()

After running these codes
 After these mistakes, my solution:
1. Check if the code is wrong
driver = webdriver.chrome() chrome() should be Chrome(), you can’t make a mistake here
2. Check if the module reference is wrong
3. In python3script Whether there is chromedriver.exe file in the directory, download it if not, download address
http://chromedriver.storage.googleapis.com/index.html
 I used the above three methods to solve it. If there is any omission, please add it.

Intelligent Recommendation

Python error TypeError: 'module' object is not callable

Cause Analysis: There are two ways to import modules from Python: Import module and from module import * The difference is that all imported things of the former need to be limited by the module name,...

Keras merge error typeerror module object is not callable

It seems that because of the version issue, the current version of the merge layer can't be used like this. Error: Solution  ...

[Python]TypeError: 'module' object is not callable Cause analysis

**Cause Analysis: There are two ways to import modules from Python: import module and from module import. The difference is that all imported objects of the former need to be qualified with the module...

python custom class TypeError: 'module' object is not callable

New to Python, when you want to learn Reptile Custom Item and references, following the custom Item Crawler used in the file, as follows: Here, tutorial.item.MyItem need to write to the file name of t...

TypeError python class encountered: 'module' object is not callable

Wrote on BookEntry.py class module, the source code for: Way call is: callable function returns a value of False Find online information that must be written in accordance with the following: Reason i...

More Recommendation

Running pipenv gives TypeError: 'module' object is not callable

Running pipenv gives TypeError: 'module' object is not callable Remember a project using pipenv installation problems encountered in virtual environments The cause of the above error: pipenv version a...

python error: TypeError: 'module' object is not callable

When call other functions or classes in Python: TypeError: 'module' object is not callable,Import and import mechanisms Details of observation import import: it is clear, attention_keras.py attention_...

Multithreading

Multithreading Multithreading Thread creation method Create a way: inherit the Thread class to rewrite the Run () method. Call START to turn on thread Create a threaded mode 2: Implement the runnable ...

[Turn] html5 listen to any App comes back key event javascript

1 Introduction H5 now there are many new features, new label, new norms, and is the major browser providers support for them, but also quite a force continuous improvement. As a front-end programmer, ...

51nod1279 Throw the plate

Link to the original question: https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1279 Idea: Greedy, you can know that if the width of the top is lower than the bottom, it is impossible to...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top