Bläddra i källkod

Update MyChrome

naibo 2 år sedan
förälder
incheckning
c749107a6a

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
.temp_to_pub/EasySpider_windows_x64/execution_instances/115.json


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
.temp_to_pub/EasySpider_windows_x64/execution_instances/116.json


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
.temp_to_pub/EasySpider_windows_x64/execution_instances/117.json


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
.temp_to_pub/EasySpider_windows_x64/execution_instances/118.json


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
.temp_to_pub/EasySpider_windows_x64/execution_instances/119.json


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
.temp_to_pub/EasySpider_windows_x64/execution_instances/120.json


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
.temp_to_pub/EasySpider_windows_x64/execution_instances/121.json


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
.temp_to_pub/EasySpider_windows_x64/execution_instances/122.json


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
.temp_to_pub/EasySpider_windows_x64/tasks/212.json


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
.temp_to_pub/EasySpider_windows_x64/tasks/234.json


+ 1 - 1
ExecuteStage/.vscode/launch.json

@@ -12,7 +12,7 @@
             "justMyCode": false,
             //  "args": ["--id", "[7]", "--read_type", "remote", "--headless", "0"]
             // "args": ["--id", "[9]", "--read_type", "remote", "--headless", "0", "--saved_file_name", "YOUTUBE"]
-            "args": ["--id", "[112]", "--headless", "0", "--user_data", "0", "--keyboard", "0"]
+            "args": ["--id", "[119]", "--headless", "0", "--user_data", "0", "--keyboard", "0"]
         }
     ]
 }

+ 16 - 8
ExecuteStage/myChrome.py

@@ -37,19 +37,21 @@ class MyChrome(webdriver.Chrome):
             except Exception as e:
                 print(e)
             find_element = False
-            # 遍历所有的 iframe 并点击里面的元素
+            # 遍历所有的 iframe 并查找里面的元素
             for iframe in iframes:
                 # 切换到 iframe
                 super().switch_to.default_content()
                 super().switch_to.frame(iframe)
                 self.iframe_env = True
                 try:
-                    # 在 iframe 中查找并点击元素
+                    # 在 iframe 中查找元素
                     # 在这个例子中,我们查找 XPath 为 '//div[1]' 的元素
                     element = super().find_element(by=by, value=value)
                     find_element = True
                 except NoSuchElementException as e:
                     print(f"No such element found in the iframe: {str(e)}")
+                except Exception as e:
+                    print(f"Exception: {str(e)}")
                 # 完成操作后切回主文档
                 # super().switch_to.default_content()
                 if find_element:
@@ -68,14 +70,14 @@ class MyChrome(webdriver.Chrome):
             # 获取所有的 iframe
             iframes = super().find_elements(By.CSS_SELECTOR, "iframe")
             find_element = False
-            # 遍历所有的 iframe 并点击里面的元素
+            # 遍历所有的 iframe 并找到里面的元素
             for iframe in iframes:
                 # 切换到 iframe
                 try:
                     super().switch_to.default_content()
                     super().switch_to.frame(iframe)
                     self.iframe_env = True
-                    # 在 iframe 中查找并点击元素
+                    # 在 iframe 中查找元素
                     # 在这个例子中,我们查找 XPath 为 '//div[1]' 的元素
                     elements = super().find_elements(by=by, value=value)
                     if len(elements) > 0:
@@ -86,6 +88,8 @@ class MyChrome(webdriver.Chrome):
                         return elements
                 except NoSuchElementException as e:
                     print(f"No such element found in the iframe: {str(e)}")
+                except Exception as e:
+                    print(f"Exception: {str(e)}")
             if not find_element:
                 raise NoSuchElementException
         else:
@@ -117,19 +121,21 @@ if sys.platform != "darwin":
                 except Exception as e:
                     print(e)
                 find_element = False
-                # 遍历所有的 iframe 并点击里面的元素
+                # 遍历所有的 iframe 并找到里面的元素
                 for iframe in iframes:
                     # 切换到 iframe
                     super().switch_to.default_content()
                     super().switch_to.frame(iframe)
                     self.iframe_env = True
                     try:
-                        # 在 iframe 中查找并点击元素
+                        # 在 iframe 中查找元素
                         # 在这个例子中,我们查找 XPath 为 '//div[1]' 的元素
                         element = super().find_element(by=by, value=value)
                         find_element = True
                     except NoSuchElementException as e:
                         print(f"No such element found in the iframe: {str(e)}")
+                    except Exception as e:
+                        print(f"Exception: {str(e)}")
                     # 完成操作后切回主文档
                     # super().switch_to.default_content()
                     if find_element:
@@ -148,14 +154,14 @@ if sys.platform != "darwin":
                 # 获取所有的 iframe
                 iframes = super().find_elements(By.CSS_SELECTOR, "iframe")
                 find_element = False
-                # 遍历所有的 iframe 并点击里面的元素
+                # 遍历所有的 iframe 并查找里面的元素
                 for iframe in iframes:
                     # 切换到 iframe
                     try:
                         super().switch_to.default_content()
                         super().switch_to.frame(iframe)
                         self.iframe_env = True
-                        # 在 iframe 中查找并点击元素
+                        # 在 iframe 中查找元素
                         # 在这个例子中,我们查找 XPath 为 '//div[1]' 的元素
                         elements = super().find_elements(by=by, value=value)
                         if len(elements) > 0:
@@ -166,6 +172,8 @@ if sys.platform != "darwin":
                             return elements
                     except NoSuchElementException as e:
                         print(f"No such element found in the iframe: {str(e)}")
+                    except Exception as e:
+                        print(f"Exception: {str(e)}")
                 if not find_element:
                     raise NoSuchElementException
             else:

+ 2 - 2
Readme.md

@@ -1,8 +1,8 @@
-<!-- ## 请您Star/Please Star
+## 请您Star/Please Star
 
 如果您觉得此工具不错,请轻轻点击此页面右上角**Star**按钮增加项目曝光度,谢谢!软件完全免费(商用除外),只求大家Star和宣传给其他需要的朋友,谢谢!
 
-If you think this tool is good, please gently click the **Star** button in the upper right corner at this page to increase the project exposure, thank you! The software is completely free (except for commercial use), only ask everyone to Star and promote it to other friends in need, thank you! -->
+If you think this tool is good, please gently click the **Star** button in the upper right corner at this page to increase the project exposure, thank you! The software is completely free (except for commercial use), only ask everyone to Star and promote it to other friends in need, thank you!
 
 # 易采集/EasySpider: Visual Code-Free Web Crawler
 

Vissa filer visades inte eftersom för många filer har ändrats