小编Mil*_*shB的帖子

如何在 Spyder 中使用代码格式化程序 Black?

我使用 Anaconda 的 Spyder 进行一些可视化。当我在 Notepad++ 中编码时,习惯了编码称为 black 的格式化程序。不幸的是,我不知道在 Spyder 中使用黑色。有人知道吗?

python formatter spyder

5
推荐指数
2
解决办法
1835
查看次数

selenium.webdriver.firefox.options-它是关于什么的?

我在看这段代码:

#! python3
from selenium.webdriver import Firefox
from selenium.webdriver.firefox.options import Options
opts = Options()
opts.set_headless()
assert opts.headless # Operating in headless mode
browser = Firefox(options=opts)
browser.get('https://duckduckgo.com')
Run Code Online (Sandbox Code Playgroud)

来源:https : //realpython.com/modern-web-automation-with-python-and-selenium/

想法是调用无头浏览器,但我不理解此代码背后的逻辑。什么是“选项”,什么是“选项”?他们到底是做什么的?什么options=opts主张?

现在尝试运行此代码,而网页duckduckgo将无法打开。知道为什么吗?

python selenium webdriver options python-3.x

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

标签 统计

python ×2

formatter ×1

options ×1

python-3.x ×1

selenium ×1

spyder ×1

webdriver ×1