免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 22117 | 回复: 0

can't kill an exited process [复制链接]

论坛徽章:
0
发表于 2020-06-06 08:06 |显示全部楼层
想把网址下按目录下载文件
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from bs4 import BeautifulSoup

options = Options()
options.headless = True

dr=webdriver.Firefox(executable_path='/usr/lib/firefox/geckodriver',options=options)
dr.get(url)
neirong= driver.page_source
driver.close()
soup = BeautifulSoup(neirong,'lxml')
k=[]
for l in soup.find_all('a'):
k.append(l.get('href'))

一直出错 安了geck到usrlibfirefox下 提示
Traceback (most recent call last):                                                                                        File "2beautifulsoup.py", line 12, in <module>                                                                            dr=webdriver.Firefox(executable_path='/usr/lib/firefox/geckodriver',options=options)                                  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/webdriver.py", line 174, in __init__              keep_alive=True)                                                                                                      File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__               self.start_session(capabilities, browser_profile)                                                                     File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session          response = self.execute(Command.NEW_SESSION, parameters)                                                              File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute                self.error_handler.check_response(response)                                                                           File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response      raise exception_class(message, screen, stacktrace)                                                                  selenium.common.exceptions.WebDriverException: Message: invalid argument: can't kill an exited process   ---------
网上有说版本有说重启
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP