simplex 1.2.26__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: simplex
3
- Version: 1.2.26
3
+ Version: 1.2.28
4
4
  Summary: Official Python SDK for Simplex API
5
5
  Home-page: https://simplex.sh
6
6
  Author: Simplex Labs, Inc.
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="simplex",
5
- version="1.2.26",
5
+ version="1.2.28",
6
6
  packages=find_packages(),
7
7
  package_data={
8
8
  "simplex": ["browser_agent/dom/*.js"], # Include JS files in the dom directory
@@ -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}/close-session",
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}/create-session",
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}/press-enter",
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:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: simplex
3
- Version: 1.2.26
3
+ Version: 1.2.28
4
4
  Summary: Official Python SDK for Simplex API
5
5
  Home-page: https://simplex.sh
6
6
  Author: Simplex Labs, Inc.
@@ -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()
@@ -1,13 +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
- print(simplex.create_login_session("buildops.com"))
11
-
12
- if __name__ == "__main__":
13
- login()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes