1、find_element driver.find_element(By.XPATH, value_xpath).text 2、页面元素解析 public_notice = self.driver.page_source public_notice_parse = BeautifulSoup(public_notice, "lxml") public_notice_ele = public_notice_parse.find_all(class_='ant-table-tbody') for tbody in public_notice_ele: for tr in tbody: td.string 3、执行js js = f"return document.getElementsByClassName('ant-input')[{index}].value" driver.execute_script(js)