本次作业练习鼠标移动(悬停):悬停触发是电商多级导航、Tooltip 提示等交互的前置条件,ActionChains.move_to_element(element).perform() 将鼠标移动到目标元素上。请 hover「手机通讯」顶级分类,在展开的子菜单中点击「智能手机」。
ActionChains(driver).move_to_element(trigger).perform() → 展开子菜单后再 click 子项:hover 会让子菜单显示(display:block)#h6_mega_nav > ul > li 中包含 "手机通讯" 的 liActionChains.move_to_element(top_li).perform(),time.sleep(0.3)#h6_p4_result 存在且 text 包含 "智能手机"