Ludovicollin commited on
Commit
972cc47
·
verified ·
1 Parent(s): 07a813c

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +13 -2
main.py CHANGED
@@ -16,10 +16,21 @@ import chainlit as cl
16
  import js2py
17
  os.environ["ANTHROPIC_API_KEY"] = os.environ["ANTHROPIC_API_KEY"]
18
 
19
- js_code = "function urlActive() {return document.getElementsByClassName('ResetWidget');}"
20
- result = js2py.eval_js(js_code)
 
 
21
 
 
 
 
 
 
 
 
 
22
  print(result)
 
23
 
24
 
25
  def library():
 
16
  import js2py
17
  os.environ["ANTHROPIC_API_KEY"] = os.environ["ANTHROPIC_API_KEY"]
18
 
19
+ js_code = """
20
+ function urlActive() {
21
+ return document.getElementsByClassName('ResetWidget');
22
+ }
23
 
24
+ var result = urlActive();
25
+ """
26
+
27
+ # Use js2py to execute the JavaScript code
28
+ context = js2py.EvalJs()
29
+ result = context.execute(js_code)
30
+
31
+ # Print the result
32
  print(result)
33
+ print(context.result)
34
 
35
 
36
  def library():