- NodeBox - a nice lib to create images of graph networks
- Python Image Library
- BeautfulSoup - HTML parser
- mechanize - automated web browsing
| function XPath(elm) { | |
| for (segs = []; elm && elm.nodeType == 1; elm = elm.parentNode) { | |
| if (elm.hasAttribute('id')) { | |
| segs.unshift('id("' + elm.getAttribute('id') + '")') | |
| return segs.join('/') | |
| } | |
| else if (elm.hasAttribute('class')) | |
| segs.unshift(elm.localName.toLowerCase() + '[@class="' + elm.getAttribute('class') + '"]') | |
| else { | |
| for (i = 1, sib = elm.previousSibling; sib; sib = sib.previousSibling) |
| # Add external css file to webkit | |
| self.view.settings().setUserStyleSheetUrl(QtCore.QUrl.fromLocalFile("selectElem.css")) | |
| # Add Local QObject and expose its slots and properties to JavaScript Context | |
| self.view.page().currentFrame().addToJavaScriptWindowObject('htmlTextEdit', self.htmlTextEdit) | |
| # Load Local jquery file to webkit | |
| jqueryfile = QtCore.QFile("jquery-1.10.2.min.js"); | |
| jqueryfile.open(QtCore.QIODevice.ReadOnly | QtCore.QIODevice.Text); | |
| jQueryJs = jqueryfile.readAll().data(); |
| .elemHover { | |
| border: #FF0000 solid thin; | |
| background-color: #EEEE00; | |
| } | |
| .elemselected { | |
| border: #FF3030 solid; | |
| background-color: #90EE90; | |
| background: #90EE90; | |
| } |
| var flag1= null; | |
| var flag2 = null; | |
| $().ready(function(){ | |
| $("*").hover(function () { | |
| if (flag1 != null) { | |
| flag1.removeClass("elemHover"); | |
| } | |
| flag1 = $(this); |