Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Weddriver processing rich text box

Shulou Source: shulou.com Published: 2022-06-03 05:11:48 11月14日 Update

By running js, this method can deal with all kinds of difficult problems. The code is as follows:

/ / set the running method of js

Def input_content (self,content):

Js = "document.getElementById ('content_ifr'). ContentWindow.document.body.innerText =' admin'" / / contentWindow does not support the latest version of firefox well

Return self.dr.execute_script (js)

Js = "document.getElementsByClassName ('ke-edit-iframe') [0] .contentDocument.body.innerText =' admin'"

Js = "document.getElementById ('content_ifr'). ContentDocument.write (' admin');" / / write will continue to write after the text, and inner will directly overwrite the current text

Tags: Text method run handle bad code version problem problem support Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Docker Shulou Tech Info Shulou Technology MariaDB