【发布时间】:2021-03-18 21:53:04
【问题描述】:
我在 Windows 10 上有以下 Eclipse 版本:
Version: 2020-09 (4.17.0)
Build id: 20200910-1200
我正在使用 PyDev。
在我的代码中,我使用 selenium 来进行一些 url 调用(网络抓取)。当某个特定的 url 不存在或至少不以我正在阅读的大多数 url 的方式存在时,我会收到以下错误:
Traceback (most recent call last):
File "C:\Users\foobar\eclipse-workspace\WeatherUndergroundUnderground\historical\BWI_Fetch.py", line 44, in <module>
main(city, month_date, start_year, end_year)
File "C:\Users\foobar\eclipse-workspace\WeatherUndergroundUnderground\historical\BWI_Fetch.py", line 22, in main
driver.get(city_url);
File "C:\Users\foobar\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 333, in get
self.execute(Command.GET, {'url': url})
File "C:\Users\foobar\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\foobar\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Reached error page: about:neterror
Exception ignored in: <function Popen.__del__ at 0x0000019267429F70>
Traceback (most recent call last):
File "C:\Users\foobar\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 945, in __del__
self._internal_poll(_deadstate=_maxsize)
File "C:\Users\foobar\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 1344, in _internal_poll
if _WaitForSingleObject(self._handle, 0) == _WAIT_OBJECT_0:
OSError: [WinError 6] The handle is invalid
当我收到此特定错误时,eclipse 仍在运行,并且按下红色停止按钮无法结束程序。我通常可以对我编写的任何其他 python 程序使用红色停止按钮,但这个代码/错误似乎挂起。如何从 Eclipse 应用程序中结束进程?
【问题讨论】:
标签: eclipse selenium selenium-webdriver windows-10 pydev