小编use*_*662的帖子

在python中,selenium模块.如何使用firefox驱动程序

我想使用Selenium的Firefox驱动程序.但是我得到了如下所示的错误.Firefox有可能无法正常安装吗?

------我的来源------

from selenium import webdriver

driver = webdriver.Firefox()
Run Code Online (Sandbox Code Playgroud)

------我的源头------

这是返回的错误:

Traceback (most recent call last):
  File "test.py", line 4, in <module>
    browser = webdriver.Firefox()
  File "/usr/local/lib/python2.7/site-packages/selenium-2.25.0-py2.7.egg/selenium/webdriver/firefox/webdriver.py", line 51, in __init__
    self.binary, timeout),
  File "/usr/local/lib/python2.7/site-packages/selenium-2.25.0-py2.7.egg/selenium/webdriver/firefox/extension_connection.py", line 47, in __init__
    self.binary.launch_browser(self.profile)
  File "/usr/local/lib/python2.7/site-packages/selenium-2.25.0-py2.7.egg/selenium/webdriver/firefox/firefox_binary.py", line 43, in launch_browser
    self._start_from_profile_path(self.profile.path)
  File "/usr/local/lib/python2.7/site-packages/selenium-2.25.0-py2.7.egg/selenium/webdriver/firefox/firefox_binary.py", line 65, in _start_from_profile_path
    env=self._firefox_env).communicate()
  File "/usr/local/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/local/lib/python2.7/subprocess.py", line 1228, in _execute_child
    raise child_exception
AttributeError: 'NoneType' object has no attribute 'rfind'
Run Code Online (Sandbox Code Playgroud)

python firefox selenium selenium-webdriver

5
推荐指数
1
解决办法
1996
查看次数

在python NLTK中,我想获得非空白字符串的形态分析结果

我想从 NLTK 对非空白字符串获取形态分析结果。

例如:

字符串是"societynamebank".

我想要得到['society', 'name', 'bank']

如何在 NLTK 上获得该结果?

python nltk morphological-analysis

0
推荐指数
1
解决办法
4948
查看次数