我正在关注 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/