When initializing browser
you missed the parentheses after the name of the class, that is, it should be like this:
browser=webdriver.Chrome()
In this way an object is created, and the variable browser
would be a reference to that new created object.
As you had it, instead:
browser=webdriver.Chrome
the variable browser
would be a reference to the class , instead of being an object, so it could not work correctly since there is no properly initialized object.
As for explaining the strange error that told you that the url
was missing, when clearly you were passing it, it is due to the following. When you tried to invoke the browser.get()
method, since browser
referenced a class instead of an object, you were not invoking an object method, but a method of the class. In the classes the methods are declared with a first extra parameter, self
, that when you invoke through a Python object it fills up automatically. In this case, however, when invoking it through the class, Python expected two parameters, self
and url
and only passed one, so the error told you that the second was missing.