在练习 Selenium控制日历控件的时候遇到的小问题,文章中用到的是ById获取的元素,我练习的网站没有ID用的ClassName,结果…
selenium.common.exceptions.JavascriptException: Message: javascript error: document.getElementsByClassName(...).removeAttribute is not a function
原因应该是removeAttribute这个方法只能对单个元素使用。用下标取其中一个就好了。