# 获取滑动条的位置 tiao = browser.find_element_by_class_name('nc-lang-cnt') tiao_size = tiao.size source = browser.find_element_by_css_selector('.nc_iconfont.btn_slide') # 获取滑块位置 source_location = source.location x_location = source_location['x'] + tiao_size['width'] y_location = source_location['y'] ActionChains(browser).drag_and_drop_by_offset(source,x_location,y_location).perform()