selenium去掉readonly

# 去掉readonly
pag = self.driver.find_element_by_xpath('//*[@id="app"]/div/div[2]/section/div/form/div[1]/div/div/div/input')
self.driver.execute_script("arguments[0].removeAttribute('readonly')", pag)
# 正常输入内容
self.driver.find_element_by_xpath('//*[@id="app"]/div/div[2]/section/div/form/div[1]/div/div/div/input').send_keys('自动化专用店铺勿动')

参考:
https://blog.csdn.net/qq_39423351/article/details/86674522
https://blog.csdn.net/qq_35531549/article/details/88138572
posted @ 2019-05-13 15:52  alluka_b  阅读(1174)  评论(1编辑  收藏  举报