【问题标题】:HTTP method not allowed when trying to capture console尝试捕获控制台时不允许使用 HTTP 方法
【发布时间】:2020-09-25 13:26:16
【问题描述】:

我正在尝试使用 Selenium 捕获 Firefox 的控制台日志,但出现“HTTP method not allowed”错误

这就是我目前的做法:

from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

# enable browser logging
d = DesiredCapabilities.FIREFOX
d['loggingPrefs'] = {'browser': 'ALL'}
driver = webdriver.Firefox(capabilities=d)
# load some site
driver.get('url')
# print messages
for entry in driver.get_log('browser'):
    print entry

我得到的错误是selenium.common.exceptions.WebDriverException: Message: HTTP method not allowed

【问题讨论】:

标签: python selenium selenium-webdriver geckodriver


【解决方案1】:

get_log 未由 Firefox 驱动程序实现。见https://github.com/mozilla/geckodriver/issues/330

【讨论】:

    猜你喜欢
    • 2020-03-30
    • 2021-02-13
    • 1970-01-01
    • 1970-01-01
    • 2016-03-08
    • 2015-05-13
    • 2017-01-10
    • 2020-07-30
    • 2019-06-17
    相关资源
    最近更新 更多