parsagon 0.15.3__py3-none-any.whl → 0.17.0__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.
parsagon/api.py CHANGED
@@ -247,7 +247,7 @@ def get_pipelines():
247
247
  return _api_call(httpx.get, f"/pipelines/")
248
248
 
249
249
 
250
- def get_pipeline_code(pipeline_name, variables, headless, use_uc, optimize, use_proxy, pipeline_id=None):
250
+ def get_pipeline_code(pipeline_name, variables, headless, use_cdp, use_uc, optimize, use_proxy, pipeline_id=None):
251
251
  if pipeline_id:
252
252
  return _api_call(
253
253
  httpx.post,
@@ -255,6 +255,7 @@ def get_pipeline_code(pipeline_name, variables, headless, use_uc, optimize, use_
255
255
  json={
256
256
  "variables": variables,
257
257
  "headless": headless,
258
+ "use_cdp": use_cdp,
258
259
  "use_uc": use_uc,
259
260
  "optimize": optimize,
260
261
  "use_proxy": use_proxy,
@@ -268,6 +269,7 @@ def get_pipeline_code(pipeline_name, variables, headless, use_uc, optimize, use_
268
269
  json={
269
270
  "variables": variables,
270
271
  "headless": headless,
272
+ "use_cdp": use_cdp,
271
273
  "use_uc": use_uc,
272
274
  "optimize": optimize,
273
275
  "use_proxy": use_proxy,
parsagon/executor.py CHANGED
@@ -157,6 +157,7 @@ class Executor:
157
157
  "get_serp_data": get_serp_data,
158
158
  "get_pdf_text": self.get_pdf_text,
159
159
  "str_to_iso8601": self.str_to_iso8601,
160
+ "get_network_requests": self.get_network_requests,
160
161
  }
161
162
  self.custom_functions = {}
162
163
  self.infer = infer
@@ -713,6 +714,17 @@ class Executor:
713
714
  s = " ".join(s.split()[:-1])
714
715
  return ""
715
716
 
717
+ def get_network_requests(window_id, delay=30):
718
+ requests = []
719
+
720
+ def handle_request(event):
721
+ requests.append(event)
722
+
723
+ driver.switch_to.window(window_id)
724
+ driver.add_cdp_listener("Network.requestWillBeSent", handle_request)
725
+ wait(delay)
726
+ return requests
727
+
716
728
  def execute(self, code):
717
729
  loc = {}
718
730
  try:
parsagon/main.py CHANGED
@@ -144,6 +144,11 @@ def get_args(argv):
144
144
  type=str,
145
145
  help="write the data to the given file path",
146
146
  )
147
+ parser_run.add_argument(
148
+ "--use_cdp",
149
+ action="store_true",
150
+ help="enable CDP (only in undetected mode)",
151
+ )
147
152
  parser_run.add_argument(
148
153
  "--undetected",
149
154
  action="store_true",
parsagon/runs.py CHANGED
@@ -28,6 +28,7 @@ def run(
28
28
  remote=False,
29
29
  output_log=False,
30
30
  output_file=None,
31
+ use_cdp=False,
31
32
  undetected=False,
32
33
  optimize=False,
33
34
  use_proxy=False,
@@ -83,7 +84,7 @@ def run(
83
84
 
84
85
  run = create_pipeline_run(pipeline_id, variables, True)
85
86
  code = get_pipeline_code(
86
- program_name, variables, headless, undetected, optimize, use_proxy, pipeline_id=program_id
87
+ program_name, variables, headless, use_cdp, undetected, optimize, use_proxy, pipeline_id=program_id
87
88
  )["code"]
88
89
  start_time = datetime.datetime.now(datetime.timezone.utc).isoformat()
89
90
  run_data = {"start_time": start_time}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: parsagon
3
- Version: 0.15.3
3
+ Version: 0.17.0
4
4
  Summary: Allows you to create browser automations with natural language
5
5
  Author-email: Sandy Suh <sandy@parsagon.io>
6
6
  Project-URL: Homepage, https://parsagon.io
@@ -1,16 +1,16 @@
1
1
  parsagon/__init__.py,sha256=_S5MlYHBViB4iY96_UbGo3mfGndE8MmFmb1EORJppK8,452
2
- parsagon/api.py,sha256=TCS1iGuzuMZI-MOtdDFA-Xwdb8ogtuOQVUJhKtTG0DY,10484
2
+ parsagon/api.py,sha256=8ZaJfx1Jnf18rFWhydcdRPswnddgDsc8UqTLIctMR0g,10565
3
3
  parsagon/assistant.py,sha256=V3NL6UdDqe74W_X3wPQ1qwFuJRvHzitXtOt-XSCXvds,4065
4
4
  parsagon/create.py,sha256=BERrBviwMvifg5OwApqdanvULJHHk39fIvnTCZN3Xkk,4432
5
5
  parsagon/custom_function.py,sha256=oEj28qItaHUnsvLIHD7kg5QL3J3aO6rW6xKKP-H-Drs,770
6
6
  parsagon/edit.py,sha256=5gtnx0gNB7Gvz8ET00SczE-ZS0TomN1um6uObP-OObE,3120
7
7
  parsagon/exceptions.py,sha256=tG1vnpmUN1GdJ1GSpe1MaWH3zWmFLZCwtOfEGu8qPP0,910
8
- parsagon/executor.py,sha256=bnwAksrXd4qbWkeV8-JfR3ASreajjGfiNZQRmZM-42Q,29554
8
+ parsagon/executor.py,sha256=_jPdLxclmLekb03JCtxvslRpfUhVotL6rnHFw9EibXE,29927
9
9
  parsagon/gui_entry.py,sha256=bqG9K0CArXWWwDGoT8aV17YLNM8MfjSf6SJ_B3QbNeA,671
10
10
  parsagon/highlights.js,sha256=2UDfUApblU9xtGgTLCq4X7rHRV0wcqDSSFZPmJS6fJg,16643
11
- parsagon/main.py,sha256=LIUE3sfiU7cuz44jgTTfSG807EHJa8avCKtJS1fF18s,9863
11
+ parsagon/main.py,sha256=_ww08Fpf1S8ePXSDg2GqtmnQvdfSgMK_AiNq5CuhWko,10001
12
12
  parsagon/print.py,sha256=-7iVKil0W9e8zX1EJMcdlqNdfpmfPxKTBtZfwzWpGYU,4106
13
- parsagon/runs.py,sha256=gi36oak3RxKo1BxB0Bc6GV8K06vrrBrEXu3NYkIVPwY,8633
13
+ parsagon/runs.py,sha256=VDvWpg3x6D67jNSffimeL7rxQy8rycsys0kjV0fNWRU,8661
14
14
  parsagon/secrets.py,sha256=72dr-6q1q2ATBkE75fT18tcvwDM-4nymTb9NDVwjHTE,545
15
15
  parsagon/settings.py,sha256=ejd9wGCOEB68n8a0M2SyzlmlwPofnzMKaxpBqYhcs34,3552
16
16
  parsagon/gui/__init__.py,sha256=ZvKZfcchSnBh__UY_XeMnQJACd1EG99ix3_SfSHth8g,68
@@ -25,8 +25,8 @@ parsagon/tests/test_invalid_args.py,sha256=TAFdHGy92lUxjljPrtODOuEGVss6rn-F5GvEK
25
25
  parsagon/tests/test_pipeline_operations.py,sha256=aEwZNtIwOl9X7jdLDLB4YEdgMp7_x8PXCINAE7RT4NY,805
26
26
  parsagon/tests/test_print.py,sha256=BG7f55YDBoL0S7k291-so_Gje_hUAQOkB-jh-bEYsJY,198
27
27
  parsagon/tests/test_secrets.py,sha256=Ctsscl2tmMTZcFAy5dnyqUlgTov2UharZgLpbRCLdEg,2662
28
- parsagon-0.15.3.dist-info/METADATA,sha256=7PBi-FXh56mCZfR8IgeqZsAcaaVa9YEV3i0Mm2qFpqs,2567
29
- parsagon-0.15.3.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
30
- parsagon-0.15.3.dist-info/entry_points.txt,sha256=I1UlPUb4oY2k9idkI8kvdkEcrjKGRSOl5pMbA6uu6kw,48
31
- parsagon-0.15.3.dist-info/top_level.txt,sha256=ih5uYQzW4qjhRKppys-WiHLIbXVZ99YdqDcfAtlcQwk,9
32
- parsagon-0.15.3.dist-info/RECORD,,
28
+ parsagon-0.17.0.dist-info/METADATA,sha256=g9XH7RSGomls3yYMfiWQLcxv5RGBQq3zauVZR7okw0g,2567
29
+ parsagon-0.17.0.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
30
+ parsagon-0.17.0.dist-info/entry_points.txt,sha256=I1UlPUb4oY2k9idkI8kvdkEcrjKGRSOl5pMbA6uu6kw,48
31
+ parsagon-0.17.0.dist-info/top_level.txt,sha256=ih5uYQzW4qjhRKppys-WiHLIbXVZ99YdqDcfAtlcQwk,9
32
+ parsagon-0.17.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (80.7.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5