firefox - Selenium WebDriverException : Reached error page

标签 firefox selenium-webdriver python-3.6 django-1.8

我正在关注 Django TDD 教程:
http://www.marinamele.com/taskbuster-django-tutorial/taskbuster-working-environment-and-start-django-project
在启动开发服务器 'python manage.py runserver' 之前和之后运行 'all_users.py' 时,出现以下错误:

Traceback (most recent call last): File "functional_tests/all_users.py", line 15, in test_it_worked self.browser.get('http://localhost:8000') File "/Users/samgao/.virtualenvs/tb_test/lib/python3.6/site->packages/selenium/webdriver/remote/webdriver.py", line 264, in get self.execute(Command.GET, {'url': url}) File "/Users/samgao/.virtualenvs/tb_test/lib/python3.6/site->packages/selenium/webdriver/remote/webdriver.py", line 252, in execute self.error_handler.check_response(response) File "/Users/samgao/.virtualenvs/tb_test/lib/python3.6/site->packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: Reached error page: >about:neterror?e=connectionFailure&u=http%3A//localhost%3A8000/&c=UTF->8&f=regular&d=Firefox%20can%E2%80%99t%20establish%20a%20connection%20to%20the%20s>erver%20at%20localhost%3A8000.

基本上无法建立与本地主机的连接。
设置和配置与上一个链接中的教程相同。

我已经为这个问题苦苦挣扎了两天,如果您能提供任何帮助,我将非常感谢。

最佳答案

我遇到了同样的错误,为我解决的问题是从 localhost 更改为 127.0.0.1:

  • :self.browser.get('http://localhost:8000')

  • 更好:self.browser.get('http://127.0.0.1:8000')

关于firefox - Selenium WebDriverException : Reached error page,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43812991/

相关文章:

python - 变量:expression mean in Python?是什么意思

macos - 在终端中更改 Pytest 颜色输出

javascript - 如何在 AJAX 调用中捕获 sec_error_unknown_issuer 错误?

javascript - 触发Firefox中的所有JavaScript事件

java - webdriver 查找但不访问元素

python - 如何将嵌套在 div 下的所有 div 抓取到列表中?

java - 使用 GeckoDriver 运行 Java Selenium WebDriver 时 Firefox 无法连接

javascript - FIREFOX:插件还是扩展?

python - 如果我的 chromedriver 与 chrome 版本不兼容,我该如何修复它?

python - 错误在 `python' : free(): invalid pointer: 0x00007fc3c90dc98e