vchrome 0.1.12__py3-none-any.whl → 0.1.14__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.12'
1
+ __version__ = '0.1.14'
2
2
  __author__ = 'v'
3
3
  # ----------------------------------------------------------------------------------------------------
4
4
  _allowed = {'Chrome'}
@@ -797,6 +797,8 @@ def cdp_client(hostname, port, debug=False, runtimeEnable=False, cfg={}):
797
797
  waiter, on_request, on_response = self.call_change[k]
798
798
  if on_response:
799
799
  body_info = self.f.cdp("Fetch.getResponseBody", {"requestId": requestId}, sessionId=rdata.get('sessionId'))
800
+ if 'base64Encoded' not in body_info:
801
+ break
800
802
  body = base64.b64decode(body_info["body"]) if body_info['base64Encoded'] else body_info["body"].encode()
801
803
  x = SniffFetch.FetchResponse({
802
804
  "url": url,
@@ -1092,9 +1094,12 @@ def cdp_client(hostname, port, debug=False, runtimeEnable=False, cfg={}):
1092
1094
  return self.f.cdp('DOM.getBoxModel', {'objectId': self.objectId})
1093
1095
  def __repr__(self):
1094
1096
  return '<DOM:[{}] [{}]>'.format(self.className, self.objectId)
1097
+ def focus(self):
1098
+ self.f.cdp('DOM.focus', {"objectId": self.objectId})
1095
1099
  def clear(self, delay_uptime=0.15, timegap=0.01, timeout=15):
1096
1100
  self.wait_show(timeout)
1097
- self.f.cdp('DOM.focus', {"objectId": self.objectId})
1101
+ self.focus()
1102
+ time.sleep(0.01)
1098
1103
  clear_ents = self.f.rootf.make_clear()
1099
1104
  for kdn in clear_ents[:2]: time.sleep(timegap); self.f.cdp('Input.dispatchKeyEvent', kdn)
1100
1105
  time.sleep(delay_uptime)
@@ -1102,7 +1107,8 @@ def cdp_client(hostname, port, debug=False, runtimeEnable=False, cfg={}):
1102
1107
  for delt in clear_ents[4:]: time.sleep(timegap); self.f.cdp('Input.dispatchKeyEvent', delt)
1103
1108
  def input(self, str, delay_time=0.02, delay_uptime=0.15, random_gap=0.01, timeout=15):
1104
1109
  self.wait_show(timeout)
1105
- self.f.cdp('DOM.focus', {"objectId": self.objectId})
1110
+ self.focus()
1111
+ time.sleep(0.01)
1106
1112
  for kdn, kup in self.f.rootf.make_input_events(str):
1107
1113
  if kdn == 'insertText':
1108
1114
  self.f.cdp('Input.insertText', {"text": kup})
@@ -1,4 +1,4 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vchrome
3
- Version: 0.1.12
3
+ Version: 0.1.14
4
4
 
@@ -0,0 +1,6 @@
1
+ v/__init__.py,sha256=6ZddLaDcwLudHWmFr2utAcYhperXw9AYoItNPm8EZSM,65
2
+ vchrome/__init__.py,sha256=ilP-O_1VJktPcarXrqDLfYMI9kHf1cY4wTzHUJYvwKM,229185
3
+ vchrome-0.1.14.dist-info/METADATA,sha256=1dsU6dFgkByeXNfk42mG47dDKLrVRwfljdl3brdBJ6E,57
4
+ vchrome-0.1.14.dist-info/WHEEL,sha256=hPN0AlP2dZM_3ZJZWP4WooepkmU9wzjGgCLCeFjkHLA,92
5
+ vchrome-0.1.14.dist-info/top_level.txt,sha256=IYbkbnFb2FGoroYj_ZXIitmnJDgYBA29_HmK9BdEUkY,10
6
+ vchrome-0.1.14.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- v/__init__.py,sha256=6ZddLaDcwLudHWmFr2utAcYhperXw9AYoItNPm8EZSM,65
2
- vchrome/__init__.py,sha256=27Y1v2rB9x7tuaF-1-WTuyiZUkBW71sSyYuZI8QmgQQ,229008
3
- vchrome-0.1.12.dist-info/METADATA,sha256=de-4TcK_FMfYKNfmoUm1JNkrdv0TO6SKbv3oDEMm_ho,57
4
- vchrome-0.1.12.dist-info/WHEEL,sha256=hPN0AlP2dZM_3ZJZWP4WooepkmU9wzjGgCLCeFjkHLA,92
5
- vchrome-0.1.12.dist-info/top_level.txt,sha256=IYbkbnFb2FGoroYj_ZXIitmnJDgYBA29_HmK9BdEUkY,10
6
- vchrome-0.1.12.dist-info/RECORD,,