i'm trying access attributes of class instance defined inside class keep getting error says there no attribute 'get'.
from selenium import webdriver class driver: proxy = [1, 2, 4] def get_driver(self): driver = webdriver.firefox() if self.proxy[0] == 1: return self driver = driver() driver.get_driver() driver.get("https://www.youtube.com/watch?v=5xxqs34umx4&index=101&list=plihuzhhwjm2gto_ikmydg7ot1enmmyodl") print driver.proxy
i can think of few ways access instance's attribute
dir(obj)
obj.__dict__
- using
ipython
's autocomplete - within interactive shell, typeobj
tab
Comments
Post a Comment