simplex 1.2.27__tar.gz → 1.2.28__tar.gz
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-1.2.27 → simplex-1.2.28}/PKG-INFO +1 -1
- {simplex-1.2.27 → simplex-1.2.28}/setup.py +1 -1
- {simplex-1.2.27 → simplex-1.2.28}/simplex/simplex.py +49 -3
- {simplex-1.2.27 → simplex-1.2.28}/simplex.egg-info/PKG-INFO +1 -1
- simplex-1.2.28/tests/test.py +43 -0
- simplex-1.2.27/tests/test.py +0 -15
- {simplex-1.2.27 → simplex-1.2.28}/LICENSE +0 -0
- {simplex-1.2.27 → simplex-1.2.28}/README.md +0 -0
- {simplex-1.2.27 → simplex-1.2.28}/pyproject.toml +0 -0
- {simplex-1.2.27 → simplex-1.2.28}/setup.cfg +0 -0
- {simplex-1.2.27 → simplex-1.2.28}/simplex/__init__.py +0 -0
- {simplex-1.2.27 → simplex-1.2.28}/simplex/cli.py +0 -0
- {simplex-1.2.27 → simplex-1.2.28}/simplex/deploy/__init__.py +0 -0
- {simplex-1.2.27 → simplex-1.2.28}/simplex/deploy/push.py +0 -0
- {simplex-1.2.27 → simplex-1.2.28}/simplex.egg-info/SOURCES.txt +0 -0
- {simplex-1.2.27 → simplex-1.2.28}/simplex.egg-info/dependency_links.txt +0 -0
- {simplex-1.2.27 → simplex-1.2.28}/simplex.egg-info/entry_points.txt +0 -0
- {simplex-1.2.27 → simplex-1.2.28}/simplex.egg-info/requires.txt +0 -0
- {simplex-1.2.27 → simplex-1.2.28}/simplex.egg-info/top_level.txt +0 -0
|
@@ -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
|
},
|
|
@@ -30,7 +30,7 @@ class Simplex:
|
|
|
30
30
|
|
|
31
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
|
},
|
|
@@ -134,7 +134,7 @@ class Simplex:
|
|
|
134
134
|
data['session_id'] = self.session_id
|
|
135
135
|
|
|
136
136
|
response = requests.post(
|
|
137
|
-
f"{BASE_URL}/
|
|
137
|
+
f"{BASE_URL}/press_enter",
|
|
138
138
|
headers={
|
|
139
139
|
'x-api-key': self.api_key
|
|
140
140
|
},
|
|
@@ -144,6 +144,52 @@ class Simplex:
|
|
|
144
144
|
return
|
|
145
145
|
else:
|
|
146
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']}")
|
|
147
193
|
|
|
148
194
|
def extract_bbox(self, element_description: str, cdp_url: str = None):
|
|
149
195
|
if not cdp_url and not self.session_id:
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from simplex import Simplex
|
|
2
|
+
import os
|
|
3
|
+
from dotenv import load_dotenv
|
|
4
|
+
import time
|
|
5
|
+
|
|
6
|
+
load_dotenv()
|
|
7
|
+
|
|
8
|
+
def login():
|
|
9
|
+
simplex = Simplex(api_key=os.getenv("SIMPLEX_API_KEY"))
|
|
10
|
+
simplex.create_session(proxies=False)
|
|
11
|
+
simplex.goto("https://github.com/login")
|
|
12
|
+
simplex.wait(3500)
|
|
13
|
+
# simplex.goto("https://browser-tests-alpha.vercel.app/api/upload-test")
|
|
14
|
+
# simplex.wait(10)
|
|
15
|
+
# print(simplex.create_login_session("https://auth.leboncoin.fr/login/"))
|
|
16
|
+
print(simplex.press_tab())
|
|
17
|
+
print(simplex.type("test@test.com"))
|
|
18
|
+
print(simplex.delete_text())
|
|
19
|
+
# print(simplex.wait(5000))
|
|
20
|
+
|
|
21
|
+
# simplex.goto("https://dropbox.com/")
|
|
22
|
+
# simplex.click("Upload or drop")
|
|
23
|
+
# simplex.click_and_upload("File", "ycombinator.svg")
|
|
24
|
+
# print(simplex.exists("Download button"))
|
|
25
|
+
# files = simplex.click_and_download("Download File")
|
|
26
|
+
# import base64
|
|
27
|
+
# print(files)
|
|
28
|
+
# # Decode base64 string to bytes
|
|
29
|
+
# file_bytes = base64.b64decode(files['b64'])
|
|
30
|
+
|
|
31
|
+
# # Create downloads directory if it doesn't exist
|
|
32
|
+
# os.makedirs('downloads', exist_ok=True)
|
|
33
|
+
|
|
34
|
+
# # Write bytes to file
|
|
35
|
+
# with open(os.path.join('downloads', files['filename']), 'wb') as f:
|
|
36
|
+
# f.write(file_bytes)
|
|
37
|
+
|
|
38
|
+
# simplex.goto("https://file-examples.com/wp-content/storage/2018/04/file_example_AVI_480_750kB.avi")
|
|
39
|
+
# print(simplex.restore_login_session("zillow_com_session_data.json"))
|
|
40
|
+
# simplex.goto("https://zillow.com")
|
|
41
|
+
|
|
42
|
+
if __name__ == "__main__":
|
|
43
|
+
login()
|
simplex-1.2.27/tests/test.py
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
from simplex import Simplex
|
|
2
|
-
import os
|
|
3
|
-
from dotenv import load_dotenv
|
|
4
|
-
import time
|
|
5
|
-
|
|
6
|
-
load_dotenv()
|
|
7
|
-
|
|
8
|
-
def login():
|
|
9
|
-
simplex = Simplex(api_key=os.getenv("SIMPLEX_API_KEY"))
|
|
10
|
-
simplex.create_session()
|
|
11
|
-
simplex.goto("live.buildops.com")
|
|
12
|
-
simplex.wait(10000)
|
|
13
|
-
|
|
14
|
-
if __name__ == "__main__":
|
|
15
|
-
login()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|