simplex 1.2.26__py3-none-any.whl → 1.2.28__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.
Potentially problematic release.
This version of simplex might be problematic. Click here for more details.
- simplex/simplex.py +52 -5
- {simplex-1.2.26.dist-info → simplex-1.2.28.dist-info}/METADATA +1 -1
- simplex-1.2.28.dist-info/RECORD +11 -0
- simplex-1.2.26.dist-info/RECORD +0 -11
- {simplex-1.2.26.dist-info → simplex-1.2.28.dist-info}/LICENSE +0 -0
- {simplex-1.2.26.dist-info → simplex-1.2.28.dist-info}/WHEEL +0 -0
- {simplex-1.2.26.dist-info → simplex-1.2.28.dist-info}/entry_points.txt +0 -0
- {simplex-1.2.26.dist-info → simplex-1.2.28.dist-info}/top_level.txt +0 -0
simplex/simplex.py
CHANGED
|
@@ -15,7 +15,7 @@ class Simplex:
|
|
|
15
15
|
if not self.session_id:
|
|
16
16
|
return
|
|
17
17
|
response = requests.post(
|
|
18
|
-
f"{BASE_URL}/
|
|
18
|
+
f"{BASE_URL}/close_session",
|
|
19
19
|
headers={
|
|
20
20
|
'x-api-key': self.api_key
|
|
21
21
|
},
|
|
@@ -28,12 +28,13 @@ class Simplex:
|
|
|
28
28
|
else:
|
|
29
29
|
raise ValueError(f"Failed to close session: {response.json()['error']}")
|
|
30
30
|
|
|
31
|
-
def create_session(self, show_in_console: bool = True):
|
|
31
|
+
def create_session(self, show_in_console: Optional[bool] = True, proxies: Optional[bool] = True):
|
|
32
32
|
response = requests.post(
|
|
33
|
-
f"{BASE_URL}/
|
|
33
|
+
f"{BASE_URL}/create_session",
|
|
34
34
|
headers={
|
|
35
35
|
'x-api-key': self.api_key
|
|
36
|
-
}
|
|
36
|
+
},
|
|
37
|
+
data={'proxies': proxies}
|
|
37
38
|
)
|
|
38
39
|
response_json = response.json()
|
|
39
40
|
if 'session_id' not in response_json:
|
|
@@ -133,7 +134,7 @@ class Simplex:
|
|
|
133
134
|
data['session_id'] = self.session_id
|
|
134
135
|
|
|
135
136
|
response = requests.post(
|
|
136
|
-
f"{BASE_URL}/
|
|
137
|
+
f"{BASE_URL}/press_enter",
|
|
137
138
|
headers={
|
|
138
139
|
'x-api-key': self.api_key
|
|
139
140
|
},
|
|
@@ -143,6 +144,52 @@ class Simplex:
|
|
|
143
144
|
return
|
|
144
145
|
else:
|
|
145
146
|
raise ValueError(f"Failed to press enter: {response.json()['error']}")
|
|
147
|
+
|
|
148
|
+
def press_tab(self, cdp_url: str = None):
|
|
149
|
+
if not cdp_url and not self.session_id:
|
|
150
|
+
raise ValueError("Must call create_session before calling action press_tab")
|
|
151
|
+
|
|
152
|
+
data = {}
|
|
153
|
+
|
|
154
|
+
if cdp_url:
|
|
155
|
+
data['cdp_url'] = cdp_url
|
|
156
|
+
else:
|
|
157
|
+
data['session_id'] = self.session_id
|
|
158
|
+
|
|
159
|
+
response = requests.post(
|
|
160
|
+
f"{BASE_URL}/press_tab",
|
|
161
|
+
headers={
|
|
162
|
+
'x-api-key': self.api_key
|
|
163
|
+
},
|
|
164
|
+
data=data
|
|
165
|
+
)
|
|
166
|
+
if response.json()["succeeded"]:
|
|
167
|
+
return
|
|
168
|
+
else:
|
|
169
|
+
raise ValueError(f"Failed to press tab: {response.json()['error']}")
|
|
170
|
+
|
|
171
|
+
def delete_text(self, cdp_url: str = None):
|
|
172
|
+
if not cdp_url and not self.session_id:
|
|
173
|
+
raise ValueError("Must call create_session before calling action delete_text")
|
|
174
|
+
|
|
175
|
+
data = {}
|
|
176
|
+
|
|
177
|
+
if cdp_url:
|
|
178
|
+
data['cdp_url'] = cdp_url
|
|
179
|
+
else:
|
|
180
|
+
data['session_id'] = self.session_id
|
|
181
|
+
|
|
182
|
+
response = requests.post(
|
|
183
|
+
f"{BASE_URL}/delete_text",
|
|
184
|
+
headers={
|
|
185
|
+
'x-api-key': self.api_key
|
|
186
|
+
},
|
|
187
|
+
data=data
|
|
188
|
+
)
|
|
189
|
+
if response.json()["succeeded"]:
|
|
190
|
+
return
|
|
191
|
+
else:
|
|
192
|
+
raise ValueError(f"Failed to delete text: {response.json()['error']}")
|
|
146
193
|
|
|
147
194
|
def extract_bbox(self, element_description: str, cdp_url: str = None):
|
|
148
195
|
if not cdp_url and not self.session_id:
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
simplex/__init__.py,sha256=L_5i__xt_ZDkr6e-Wx9cr84t9sXpioOT7j01NJYJCTE,75
|
|
2
|
+
simplex/cli.py,sha256=zRf59YFwDg3mrPeAuYh6pvOidRLiKkQ_NdYVP2XAXTY,2481
|
|
3
|
+
simplex/simplex.py,sha256=R0KcvnIANySK_sYkM-qtD5SIbNbTfn6_KL3nco-nUao,13809
|
|
4
|
+
simplex/deploy/__init__.py,sha256=_JQ81F_Nu7hSAfMA691gzs6a4-8oZ-buJ9h3Au12BKw,96
|
|
5
|
+
simplex/deploy/push.py,sha256=hRAbtFZaECKnBljaOLQ5nzJ6hk7tZgc1c7QdgxKQFoY,6123
|
|
6
|
+
simplex-1.2.28.dist-info/LICENSE,sha256=Xh0SJjYZfNI71pCNMB40aKlBLLuOB0blx5xkTtufFNQ,1075
|
|
7
|
+
simplex-1.2.28.dist-info/METADATA,sha256=G7byF_8lnKHGjpPy2nPgTvxrLY4gMcud2EqKmaE49Bc,938
|
|
8
|
+
simplex-1.2.28.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
9
|
+
simplex-1.2.28.dist-info/entry_points.txt,sha256=3veL2w3c5vxb3dm8I_M8Fs-370n1ZnvD8uu1nSsL7z8,45
|
|
10
|
+
simplex-1.2.28.dist-info/top_level.txt,sha256=cbMH1bYpN0A3gP-ecibPRHasHoqB-01T_2BUFS8p0CE,8
|
|
11
|
+
simplex-1.2.28.dist-info/RECORD,,
|
simplex-1.2.26.dist-info/RECORD
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
simplex/__init__.py,sha256=L_5i__xt_ZDkr6e-Wx9cr84t9sXpioOT7j01NJYJCTE,75
|
|
2
|
-
simplex/cli.py,sha256=zRf59YFwDg3mrPeAuYh6pvOidRLiKkQ_NdYVP2XAXTY,2481
|
|
3
|
-
simplex/simplex.py,sha256=V41daEs5y0LwNosl_xw8gMrhssn420C5e-9HZ_s6Euk,12378
|
|
4
|
-
simplex/deploy/__init__.py,sha256=_JQ81F_Nu7hSAfMA691gzs6a4-8oZ-buJ9h3Au12BKw,96
|
|
5
|
-
simplex/deploy/push.py,sha256=hRAbtFZaECKnBljaOLQ5nzJ6hk7tZgc1c7QdgxKQFoY,6123
|
|
6
|
-
simplex-1.2.26.dist-info/LICENSE,sha256=Xh0SJjYZfNI71pCNMB40aKlBLLuOB0blx5xkTtufFNQ,1075
|
|
7
|
-
simplex-1.2.26.dist-info/METADATA,sha256=Yvcs_Ewct37BnfWQhzRkdwJD2-2nT-okg6K77faGCPY,938
|
|
8
|
-
simplex-1.2.26.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
9
|
-
simplex-1.2.26.dist-info/entry_points.txt,sha256=3veL2w3c5vxb3dm8I_M8Fs-370n1ZnvD8uu1nSsL7z8,45
|
|
10
|
-
simplex-1.2.26.dist-info/top_level.txt,sha256=cbMH1bYpN0A3gP-ecibPRHasHoqB-01T_2BUFS8p0CE,8
|
|
11
|
-
simplex-1.2.26.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|