WebBrowser/Tools/Scripts.py

branch
QtWebEngine
changeset 4733
ae291a307ea6
parent 4731
67d861d9e492
child 4741
f9e1adc69076
equal deleted inserted replaced
4732:5ac4fc1dfc20 4733:ae291a307ea6
152 res.inputs.push([input.name, input.value]); 152 res.inputs.push([input.name, input.value]);
153 }} 153 }}
154 return res; 154 return res;
155 }})()""" 155 }})()"""
156 return source.format(pos.x(), pos.y()) 156 return source.format(pos.x(), pos.y())
157
158
159 def getAllMetaAttributes():
160 """
161 Function generating a script to extract all meta attributes of a web page.
162
163 @return script to extract meta attributes
164 @rtype str
165 """
166 source = """
167 (function() {
168 var out = [];
169 var meta = document.getElementsByTagName('meta');
170 for (var i = 0; i < meta.length; ++i) {
171 var e = meta[i];
172 out.push({
173 name: e.getAttribute('name'),
174 content: e.getAttribute('content'),
175 httpequiv: e.getAttribute('http-equiv')
176 });
177 }
178 return out;
179 })()"""
180 return source

eric ide

mercurial