vchrome 0.0.1__py3-none-any.whl → 0.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
vchrome/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = '0.0.1'
1
+ __version__ = '0.0.2'
2
2
  __author__ = 'v'
3
3
  # ----------------------------------------------------------------------------------------------------
4
4
  _allowed = {'Chrome'}
@@ -1363,9 +1363,19 @@ def cdp_client(hostname, port, debug=False):
1363
1363
  _trav(snode)
1364
1364
  _trav(rnode)
1365
1365
  return clist
1366
+ def _get_doc_tree(self):
1367
+ start = perf_counter()
1368
+ while True:
1369
+ doc = self.f.cdp('DOM.getDocument', {'depth':-1, 'pierce':True})
1370
+ if 'root' in doc:
1371
+ return doc
1372
+ else:
1373
+ time.sleep(0.1)
1374
+ if perf_counter() - start > 2:
1375
+ break
1366
1376
  def _get_flattened_node(self, nodeId=None):
1367
1377
  if nodeId == None:
1368
- rnode = self.f.cdp('DOM.getDocument', {'depth':-1, 'pierce':True})['root']
1378
+ rnode = self._get_doc_tree()['root']
1369
1379
  else:
1370
1380
  rnode = self.f.cdp('DOM.describeNode', {'nodeId':nodeId, 'depth':-1, 'pierce':True})['node']
1371
1381
  mnodes = {"nodes": self._trav_node_tree(rnode)}
@@ -1,3 +1,3 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vchrome
3
- Version: 0.0.1
3
+ Version: 0.0.2
@@ -0,0 +1,5 @@
1
+ vchrome/__init__.py,sha256=GaD-j4I3g4mHbDtGiCd8-5M7iXKaC7CWJiXqJH_XXyk,205606
2
+ vchrome-0.0.2.dist-info/METADATA,sha256=irZzBMagQl2VCh9fQTf-sLyWJOLcc2f0P4TWbvRpRBM,54
3
+ vchrome-0.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
4
+ vchrome-0.0.2.dist-info/top_level.txt,sha256=oB919Fa09PCy48Ptj8iy-1QUcvhEeY97MOR42281Fk0,8
5
+ vchrome-0.0.2.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- vchrome/__init__.py,sha256=3hGkPIEIEqdztxgUv_xzCfSh94LydiST-h0aRbbKcFo,205275
2
- vchrome-0.0.1.dist-info/METADATA,sha256=sYEl8TU0KeoZfxt5CiNQCP9kl_jR6ztqpO9cHeOQzfk,54
3
- vchrome-0.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
4
- vchrome-0.0.1.dist-info/top_level.txt,sha256=oB919Fa09PCy48Ptj8iy-1QUcvhEeY97MOR42281Fk0,8
5
- vchrome-0.0.1.dist-info/RECORD,,