python - Python - Selenium wrong url or server out of reach
问题描述
How to handle url exceptions. If user enter a wrong url or the server does not response
browser = webdriver.Chrome('chromedriver')
browser.get('http://www.abc.abc/')
I am using python. Program does not throw error if url is wrong or server out of reach
解决方案
如何处理任何异常示例
try:
browser.get('http://www.abc.abc/')
except Exception as e:
print("except -> browser.get -> %s" %e)
推荐阅读
- sapui5 - SAPUI5 timeseries_stacked_column 图表显示空周,即使没有数据
- python - TypeError:“DataFrame”对象不可调用 - 火花数据框
- asp.net - 使用 Windbg 查找 asp.net 应用程序中的内存泄漏问题
- c++ - 使用 g++ 构建二进制文件时谁确定 GLIBCXX_version?
- linux - How to create multiple URLs for JIRA and Confluence?
- python - Plotly: How to make stacked bar chart from single trace?
- kubernetes - Kubernetes - 一次“服务”的最大并发请求限制
- python - Unable to install Airflow even after setting SLUGIFY_USES_TEXT_UNIDECODE and AIRFLOW_GPL_UNIDECODE
- julia - Is there a lazy `filter` in Julia?
- centos7 - perl 脚本,可以上传图像,通过 imagemagick 命令进行裁剪并使其清晰