环境:python3.6 + selenium 3.11 + chromedriver.exe
我们在解析网页的时候,总是会遇到大量的tag,如何精确定位到这些tag,也是有很多的方法。
今天在用 find_element_by_class_name获取一个节点对象时,报了个错 Compound class names not permitted.
需要解析的页面结构:
原始代码:
selected_div = driver.find_element_by_class_name('next-pagination next-pagination-normal next-pagination-medium medium pagination')
运行后报错了:
修改后的代码:
selected_div = driver.find_element