isrpa 1.0.1__tar.gz → 1.0.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: isrpa
3
- Version: 1.0.1
3
+ Version: 1.0.3
4
4
  Summary: isrpa package
5
5
  Home-page: https://github.com/yourusername/mypackage
6
6
  Author: ysq
@@ -27,11 +27,46 @@ def getPath(user_name):
27
27
  if response.status_code != 200:
28
28
  return "failure"
29
29
  port = response.json()
30
- url = f"http://localhost:{port}/json/version"
31
- response = requests.get(url)
30
+
31
+ def get_ws_url():
32
+ url = f"http://localhost:{port}/json/version"
33
+ response = requests.get(url)
34
+ if response.status_code != 200:
35
+ return "failure"
36
+ return response.json().get('webSocketDebuggerUrl')
37
+
38
+ ws_url = get_ws_url()
39
+ return ws_url
40
+
41
+
42
+ def get_active_page(browser, user_name):
43
+ """
44
+ 获取当前激活page对象
45
+ """
46
+ url = f"{address}/client/getPath"
47
+ headers = {'Content-Type': 'application/json'}
48
+ data = {'user_name': user_name}
49
+ response = requests.post(url, headers=headers, json=data)
32
50
  if response.status_code != 200:
33
51
  return "failure"
34
- return response.json().get('webSocketDebuggerUrl')
52
+ port = response.json()
53
+
54
+ def get_json():
55
+ url = f"http://localhost:{port}/json"
56
+ response = requests.get(url)
57
+ if response.status_code != 200:
58
+ return "failure"
59
+ return response.json()
60
+
61
+ data = get_json()
62
+
63
+ for t in data:
64
+ if t.get("type") == "page":
65
+ active_url = t.get("url")
66
+ for page in browser.contexts[0].pages:
67
+ if page.url == active_url:
68
+ page.bring_to_front()
69
+ return page
35
70
 
36
71
 
37
72
  def upload_file(file_path, dest_file, user_name):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: isrpa
3
- Version: 1.0.1
3
+ Version: 1.0.3
4
4
  Summary: isrpa package
5
5
  Home-page: https://github.com/yourusername/mypackage
6
6
  Author: ysq
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='isrpa',
5
- version='1.0.1',
5
+ version='1.0.3',
6
6
  packages=find_packages(),
7
7
  install_requires=["requests", "tldextract"],
8
8
  author='ysq',
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