当前位置:   article > 正文

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate的解决办法_message: no such element: unable to locate element

message: no such element: unable to locate element: {"method":"css selector

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {“method”:“css selector”,“selector”:“.curr-shop hd-shopname”} (Session info: chrome=100.0.4896.75)

在这里插入图片描述
这里其实是由两个类(class)组成的div,而在find_element_by_class_name()方法中只能选择一个类名。所以把代码
shopname=good.find_element_by_class_name(‘curr-shop hd-shopname’).text
改为:
shopname=good.find_element_by_class_name(‘curr-shop’).text即可

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/697054
推荐阅读