java.io.IOException: Server returned HTTP response code: 403 for URL: http://
来源:互联网 发布:男人福利直播软件 编辑:程序博客网 时间:2024/05/16 07:58
java.io.IOException: Server returned HTTP response code: 403 for URL: http://
这个是什么异常呢?
当你使用java程序检索其他网站上的内容时,如果其服务器设置了禁止抓取,或者其访问需要权限,
如果此时你去检索网页那么就会有异常该异常出现.
如果是服务器需要访问权限,比如说你要登录才能访问的网页,那么你抓取不了的.
如果是服务器端禁止抓取,那么这个你可以通过设置User-Agent来欺骗服务器
connection.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
什么是User Agent呢?
User Agent中文名为用户代理,简称 UA,它是一个特殊字符串头,使得服务器能够识别客户使用的操作系统及版本、CPU 类型、浏览器及版本、浏览器渲染引擎、浏览器语言、浏览器插件等。
一些网站常常通过判断 UA 来给不同的操作系统、不同的浏览器发送不同的页面,因此可能造成某些页面无法在某个浏览器中正常显示,但通过伪装 UA 可以绕过检测。
- java.io.IOException: Server returned HTTP response code: 403 for URL: http://
- java.io.IOException: Server returned HTTP response code: 403 for URL: http://
- java.io.IOException: Server returned HTTP response code: 403 for URL: http://的解决办法
- 用户代理及 java.io.IOException: Server returned HTTP response code: 403 for URL
- java.io.IOException: Server returned HTTP response code: 403 for URL
- 用户代理异常:java.io.IOException: Server returned HTTP response code: 403 for URL
- java.io.IOException: Server returned HTTP response code: 505 for URL: http://localhost:8080/fish/add
- java.io.IOException: Server returned HTTP response code: 403 for URL: http://query.sse.com.cn/infodi
- java.io.IOException: Server returned HTTP response code: 500 for URL
- java.io.IOException: Server returned HTTP response code: 500 for URL
- java.io.IOException: Server returned HTTP response code: 400 for URL解决方法
- java.io.IOException: Server returned HTTP response code: 505 for URL: 问题
- java.io.ioexception: server returned http response code: 500 for url:
- [报错总结]java.io.IOException: Server returned HTTP response code: 500 for URL:
- java.io.IOException: Server returned HTTP response code: 500 for URL解决办法
- java.io.IOException: Server returned HTTP response code: 405 for URL: *********处理方法
- Exception in thread "main" java.io.IOException: Server returned HTTP response code: 400 for URL解决方案
- java.io.IOException: Server returned HTTP response code: 415 for URL:xxxxxx
- 利用FlashPaper实现类似百度文库功能
- auto_ptr 代码及缺陷
- android binder机制及其源码解析 之第二节重要函数讲解之常用数据结构(一)
- 立此存照:图像处理技术将大放异彩
- [转]Fedora 15安装VirtualBox 4.0
- java.io.IOException: Server returned HTTP response code: 403 for URL: http://
- XMLHttpRequest 传递中文 乱码
- 软件研发之道——知识产权
- 6.1.6 Gallery结合案例详解
- 要看的牛贴
- Fedora 15安装flash插件(yum flash-plugin)
- SQL行列转换等经典sql操作
- 黑马程序员-Java反射机制及JDK动态代理技术
- 一些正则xpath教程与工具