<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><br></div><div>Greetings All,</div><div><br></div><div>okay, Back at the front,...</div><div><br></div><div>Let's say we use QWebKit to read an HTML file containing a javascript textField...like so:</div><div><br></div><div style="margin-left: 40px;"><html><body><br><p><br> <form name="thisForm"><br> <tr><br> <td>Name:</td> <td><input type=text name="name" id="nameId" value="John"></td><br> </tr><br> </form><br></body></html></div><div><br></div><div>When displayed,..the user types "Mary" into the field, replacing "John".</div><div>Then using a method I,
uh...derived...from a related web example...</div><div>We want to "capture" the HTML being displayed and save it out to file....</div><div><br></div><div>But,..we need the resulting file to contain the new user input text "Mary"...not John...</div><div>so that on subsequent reloads, the HTML textField will display "Mary",etc...</div><div><br></div><div>Here's the snippet to cache...</div><div><br></div><div style="margin-left: 40px;"> def DoIt(self):<br> print "Saving..."<br><br> data = self.webview.page().mainFrame().toHtml()<br> thisFile = "test.html"<br> open(QtCore.QString(thisFile), 'w').write(data)<br><br> print "Done!"</div><div><br></div><div>However, it saves out "John" instead of "Mary"....</div><div><br></div><div>Can
anybody offer any solutions to this ? And/or offer any other suggestions or workarounds</div><div>to accomplish same ?</div><div><br></div><div>Thank you all very much,</div><div>Jim</div><div><br></div><div><br></div><div>Both these short files are attached as a zip..</div><div>Please NOTE: in the .py file you will need to edit the path to the html file to reflect your environment.</div><div>Using "file://" requires absolute paths.</div><div><br></div><div><br></div><div></div></div></body></html>