vchrome 0.1.7__py3-none-any.whl → 0.1.8__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.1.7'
1
+ __version__ = '0.1.8'
2
2
  __author__ = 'v'
3
3
  # ----------------------------------------------------------------------------------------------------
4
4
  _allowed = {'Chrome'}
@@ -908,7 +908,7 @@ def cdp_client(hostname, port, debug=False, runtimeEnable=False, cfg={}):
908
908
  "waitForDebuggerOnStart": True,
909
909
  "flatten": True,
910
910
  }, sessionId=sessionId)
911
- self.f.cdp('DOM.enable', sessionId=sessionId)
911
+ # self.f.cdp('DOM.enable', sessionId=sessionId) # only call api. not listen events, no need enable.
912
912
  self.f.cdp('Page.enable', sessionId=sessionId)
913
913
  if runtimeEnable: self.f.cdp('Runtime.enable', sessionId=sessionId)
914
914
  self.f.add_sniff_session(sessionId)
@@ -1162,8 +1162,9 @@ def cdp_client(hostname, port, debug=False, runtimeEnable=False, cfg={}):
1162
1162
  px, py = x, y
1163
1163
  if count > 1 or acount > 5:
1164
1164
  break
1165
- if perf_counter() - start > timeout:
1166
- raise Exception('wait show over time.')
1165
+ else:
1166
+ if perf_counter() - start > timeout:
1167
+ raise Exception('wait show over time.')
1167
1168
  time.sleep(0.08)
1168
1169
  if pretime:
1169
1170
  time.sleep(pretime) # When the component appears, the event might not have been attached yet. Please wait a moment.
@@ -1318,7 +1319,8 @@ def cdp_client(hostname, port, debug=False, runtimeEnable=False, cfg={}):
1318
1319
  def __add__(self, other):
1319
1320
  einfo = self.r_obj('function(){return this["toString"]()}', objectId=self.objectId, returnByValue=False)
1320
1321
  return self.f._parse_js2py(einfo, self, iso=self.iso) + str(other)
1321
- text = property(lambda s:s['outerHTML'] or s['textContent'])
1322
+ html = property(lambda s:s['outerHTML'] or s['textContent'])
1323
+ text = property(lambda s:s['textContent'])
1322
1324
  previous = property(lambda s:s['previousElementSibling'])
1323
1325
  next = property(lambda s:s['nextElementSibling'])
1324
1326
  parent = property(lambda s:s['parentElement'])
@@ -1913,7 +1915,7 @@ def cdp_client(hostname, port, debug=False, runtimeEnable=False, cfg={}):
1913
1915
  class DOM:
1914
1916
  def __init__(self, f):
1915
1917
  self.f = f
1916
- self.f.cdp('DOM.enable')
1918
+ # self.f.cdp('DOM.enable') # only call api. not listen events, no need enable.
1917
1919
  class Cache:
1918
1920
  def __init__(self, f):
1919
1921
  self.f = f
@@ -1926,8 +1928,9 @@ def cdp_client(hostname, port, debug=False, runtimeEnable=False, cfg={}):
1926
1928
  self._cache_cdp(sessionId)
1927
1929
  self.is_enable = True
1928
1930
  def _cache_cdp(self, sessionId):
1929
- self.f.cdp('Network.enable', sessionId=sessionId)
1930
- self.f.cdp('Storage.enable', sessionId=sessionId)
1931
+ # self.f.cdp('Network.enable', sessionId=sessionId) # only call api. not listen events, no need enable.
1932
+ # self.f.cdp('Storage.enable', sessionId=sessionId) # only call api. not listen events, no need enable.
1933
+ pass
1931
1934
  def attach(self, f):
1932
1935
  f.clear_cache = self.clear_cache
1933
1936
  def add_cache_session(self, sessionId):
@@ -1,4 +1,4 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vchrome
3
- Version: 0.1.7
3
+ Version: 0.1.8
4
4
 
@@ -0,0 +1,6 @@
1
+ v/__init__.py,sha256=6ZddLaDcwLudHWmFr2utAcYhperXw9AYoItNPm8EZSM,65
2
+ vchrome/__init__.py,sha256=3Y9tBJV5R1aId75qSUdN0PKGrTmoYgE7jz4VobzOCQQ,226977
3
+ vchrome-0.1.8.dist-info/METADATA,sha256=hk-Kct-6jTMpTF4sQAy_daHA6HNkBaBXYoVC18WdVYw,56
4
+ vchrome-0.1.8.dist-info/WHEEL,sha256=hPN0AlP2dZM_3ZJZWP4WooepkmU9wzjGgCLCeFjkHLA,92
5
+ vchrome-0.1.8.dist-info/top_level.txt,sha256=IYbkbnFb2FGoroYj_ZXIitmnJDgYBA29_HmK9BdEUkY,10
6
+ vchrome-0.1.8.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- v/__init__.py,sha256=6ZddLaDcwLudHWmFr2utAcYhperXw9AYoItNPm8EZSM,65
2
- vchrome/__init__.py,sha256=Pmp8KIUPMjdmW-t6iyYnYy329l074Z7Y2FOVcCH2aL8,226660
3
- vchrome-0.1.7.dist-info/METADATA,sha256=g050rIVhk4jDo9duVobzL5OzMeQbyPErnIhiWZgtb4U,56
4
- vchrome-0.1.7.dist-info/WHEEL,sha256=hPN0AlP2dZM_3ZJZWP4WooepkmU9wzjGgCLCeFjkHLA,92
5
- vchrome-0.1.7.dist-info/top_level.txt,sha256=IYbkbnFb2FGoroYj_ZXIitmnJDgYBA29_HmK9BdEUkY,10
6
- vchrome-0.1.7.dist-info/RECORD,,