简体   繁体   中英

Javafx Webview change text field content

I am trying to find and element (input text field) on a web page in WebView and then put some text inside it.

So far I got to the part where I can find the element on a page , but I cant figure out how to manupilate with it, like put some text inside it.

The code bellow puts text inside Element but on the page in webview nothing changes.

Document doc = webEngine.getDocument();
Element form1 = doc.getElementById("SPSENDERINFORMATIONADD1");
form1.setTextContent("Some text");  

我已经使用JavaScript webEngine.executeScript(“ document.getElementById(\\” SPSENDERINFORMATIONADD1 \\“)。value ='SomeText'”);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM