driver.find_element_by_class_name('pass-text-input pass-text-input-phone').send_keys('1234567890')
出错原因是因为class_name中的空格是后代选择器,只需要将空格及其前面的删除及可解决
```python
selenium.common.exceptions.InvalidSelectorException: Message: The given selector pass-text-input pass-text-input-phone is either invalid or does not result in a WebElement. The following error occurred:
InvalidSelectorError: Compound class names not permitted

下面是正确的:

driver.find_element_by_class_name('pass-text-input-phone').send_keys('1234567890')
Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐