vchrome 0.1.8__py3-none-any.whl → 0.1.9__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 +12 -10
- {vchrome-0.1.8.dist-info → vchrome-0.1.9.dist-info}/METADATA +1 -1
- vchrome-0.1.9.dist-info/RECORD +6 -0
- vchrome-0.1.8.dist-info/RECORD +0 -6
- {vchrome-0.1.8.dist-info → vchrome-0.1.9.dist-info}/WHEEL +0 -0
- {vchrome-0.1.8.dist-info → vchrome-0.1.9.dist-info}/top_level.txt +0 -0
vchrome/__init__.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
__version__ = '0.1.
|
|
1
|
+
__version__ = '0.1.9'
|
|
2
2
|
__author__ = 'v'
|
|
3
3
|
# ----------------------------------------------------------------------------------------------------
|
|
4
4
|
_allowed = {'Chrome'}
|
|
@@ -1072,16 +1072,16 @@ def cdp_client(hostname, port, debug=False, runtimeEnable=False, cfg={}):
|
|
|
1072
1072
|
return self.f.cdp('DOM.getBoxModel', {'objectId': self.objectId})
|
|
1073
1073
|
def __repr__(self):
|
|
1074
1074
|
return '<DOM:[{}] [{}]>'.format(self.className, self.objectId)
|
|
1075
|
-
def clear(self, delay_uptime=0.15, timegap=0.01):
|
|
1076
|
-
self.wait_show()
|
|
1075
|
+
def clear(self, delay_uptime=0.15, timegap=0.01, timeout=15):
|
|
1076
|
+
self.wait_show(timeout)
|
|
1077
1077
|
self.f.cdp('DOM.focus', {"objectId": self.objectId})
|
|
1078
1078
|
clear_ents = self.f.rootf.make_clear()
|
|
1079
1079
|
for kdn in clear_ents[:2]: time.sleep(timegap); self.f.cdp('Input.dispatchKeyEvent', kdn)
|
|
1080
1080
|
time.sleep(delay_uptime)
|
|
1081
1081
|
for kup in clear_ents[2:4]: time.sleep(timegap); self.f.cdp('Input.dispatchKeyEvent', kup)
|
|
1082
1082
|
for delt in clear_ents[4:]: time.sleep(timegap); self.f.cdp('Input.dispatchKeyEvent', delt)
|
|
1083
|
-
def input(self, str, delay_time=0.02, delay_uptime=0.15, random_gap=0.01):
|
|
1084
|
-
self.wait_show()
|
|
1083
|
+
def input(self, str, delay_time=0.02, delay_uptime=0.15, random_gap=0.01, timeout=15):
|
|
1084
|
+
self.wait_show(timeout)
|
|
1085
1085
|
self.f.cdp('DOM.focus', {"objectId": self.objectId})
|
|
1086
1086
|
for kdn, kup in self.f.rootf.make_input_events(str):
|
|
1087
1087
|
if kdn == 'insertText':
|
|
@@ -1112,8 +1112,8 @@ def cdp_client(hostname, port, debug=False, runtimeEnable=False, cfg={}):
|
|
|
1112
1112
|
return _x, _y
|
|
1113
1113
|
def _set_in_view(self):
|
|
1114
1114
|
self.f.cdp('DOM.scrollIntoViewIfNeeded', {"objectId": self.objectId})
|
|
1115
|
-
def click(self, x=1, y=2, zero='center', button='left', count=1):
|
|
1116
|
-
self.wait_show()
|
|
1115
|
+
def click(self, x=1, y=2, zero='center', button='left', count=1, timeout=15):
|
|
1116
|
+
self.wait_show(timeout)
|
|
1117
1117
|
self._set_in_view()
|
|
1118
1118
|
_x, _y = self._get_xy(x, y, zero)
|
|
1119
1119
|
self.f.cdp('Input.dispatchMouseEvent',{"buttons":0,"type":"mouseMoved","x":_x,"y":_y,"button":"none","clickCount":0})
|
|
@@ -1146,7 +1146,7 @@ def cdp_client(hostname, port, debug=False, runtimeEnable=False, cfg={}):
|
|
|
1146
1146
|
y += points[i][1]*B
|
|
1147
1147
|
r.append([x, y])
|
|
1148
1148
|
return r
|
|
1149
|
-
def wait_show(self, timeout=
|
|
1149
|
+
def wait_show(self, timeout=15, pretime=0.1):
|
|
1150
1150
|
start = perf_counter()
|
|
1151
1151
|
count, acount = 0, 0
|
|
1152
1152
|
px, py = 0, 0
|
|
@@ -1168,8 +1168,8 @@ def cdp_client(hostname, port, debug=False, runtimeEnable=False, cfg={}):
|
|
|
1168
1168
|
time.sleep(0.08)
|
|
1169
1169
|
if pretime:
|
|
1170
1170
|
time.sleep(pretime) # When the component appears, the event might not have been attached yet. Please wait a moment.
|
|
1171
|
-
def drag(self, x=1, y=2, zero='center', button='left', count=1):
|
|
1172
|
-
self.wait_show()
|
|
1171
|
+
def drag(self, x=1, y=2, zero='center', button='left', count=1, timeout=15):
|
|
1172
|
+
self.wait_show(timeout)
|
|
1173
1173
|
self._set_in_view()
|
|
1174
1174
|
x, y = self._get_xy(x, y, zero)
|
|
1175
1175
|
self.cache_xy = [x, y]
|
|
@@ -2805,6 +2805,7 @@ class Chrome:
|
|
|
2805
2805
|
userAgent = property(lambda s:s.get_userAgent(), lambda s,v:s.set_userAgent(v))
|
|
2806
2806
|
languages = property(lambda s:s.get_languages(), lambda s,v:s.set_languages(v))
|
|
2807
2807
|
platform = property(lambda s:s.get_platform(), lambda s,v:s.set_platform(v))
|
|
2808
|
+
html = property(lambda s:s['document']['documentElement']['outerHTML'])
|
|
2808
2809
|
return Chrome(self.root, self.dr.root._new_driver(not foreground))
|
|
2809
2810
|
frames = property(lambda s:s.dr.frames)
|
|
2810
2811
|
cookies = property(lambda s:s.get_cookies(), lambda s,v:s.set_cookies(v))
|
|
@@ -2812,6 +2813,7 @@ class Chrome:
|
|
|
2812
2813
|
userAgent = property(lambda s:s.get_userAgent(), lambda s,v:s.set_userAgent(v))
|
|
2813
2814
|
languages = property(lambda s:s.get_languages(), lambda s,v:s.set_languages(v))
|
|
2814
2815
|
platform = property(lambda s:s.get_platform(), lambda s,v:s.set_platform(v))
|
|
2816
|
+
html = property(lambda s:s['document']['documentElement']['outerHTML'])
|
|
2815
2817
|
def _check_lower_version(self):
|
|
2816
2818
|
try:
|
|
2817
2819
|
version = self.dr.root.version
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
v/__init__.py,sha256=6ZddLaDcwLudHWmFr2utAcYhperXw9AYoItNPm8EZSM,65
|
|
2
|
+
vchrome/__init__.py,sha256=jSrnEZLp3_atYOrh3Sd-QF2n1ynTIwIuCGXnuXIR_DM,227216
|
|
3
|
+
vchrome-0.1.9.dist-info/METADATA,sha256=s8cXPtNAplO0IEcCir-q9X-souSVzmAR4ocahqNlCFw,56
|
|
4
|
+
vchrome-0.1.9.dist-info/WHEEL,sha256=hPN0AlP2dZM_3ZJZWP4WooepkmU9wzjGgCLCeFjkHLA,92
|
|
5
|
+
vchrome-0.1.9.dist-info/top_level.txt,sha256=IYbkbnFb2FGoroYj_ZXIitmnJDgYBA29_HmK9BdEUkY,10
|
|
6
|
+
vchrome-0.1.9.dist-info/RECORD,,
|
vchrome-0.1.8.dist-info/RECORD
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
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,,
|
|
File without changes
|
|
File without changes
|