我正在Linux上运行一个简单的selenium示例:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get("something")
Run Code Online (Sandbox Code Playgroud)
并得到一个错误:
FileNotFoundError: [Errno 2] No such file or directory: 'geckodriver'
Run Code Online (Sandbox Code Playgroud)
怎么解决?
$ python
Python 3.5.2 (default, Jun 28 2016, 08:46:01)
[GCC 6.1.1 20160602] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import selenium
>>> from selenium.webdriver.common.keys import Keys
>>>
Run Code Online (Sandbox Code Playgroud) 我想删除所有换行符号:
aaa = """
fdsfds fdsfds
fdsfdsfds
fdsfdsfds
""" |> String.strip("\r\n")
Run Code Online (Sandbox Code Playgroud)
我得到:
argument error
Run Code Online (Sandbox Code Playgroud)
这有什么问题?
为Phoenix/Elixir应用程序获取基本域的惯用方法是什么?不是单个请求,而是应用程序的基本域,可能取决于其当前环境.
所以本地应该是localhost,但在服务器上,它可以是"dev.my_domain.com","my_domain.com"或我可以在我的应用程序中使用的其他东西.
当然,我可以在一个config/dev.exs或中添加一个特殊的密钥config/prod.exs,但我认为可能已经有一个我可以重用的密钥.