如图,下载按钮 查看其元素,是无法直接定位的,通过xpath也无法定位,转为firepath获取的CSS也是无效的#downloadItems>a 但是为经过firepath,直接在html下复制CSS是可以被定位使用的 html body div.pt.pt-right div.cont dl.newcodecontent dd#downloadItems a 完整的脚本为 browser.find_element_by_css_selector("html body div.pt.pt…
This page will show you some CSS rules and pseudo-classes that will help you move your XPATH locators to CSS, a native approach on all browsers. I: Simple Direct child A direct child in XPATH is defined by the use of a "/", while on CSS, it's de…