403错误怎么解决啊?
server吧
全部回复
仅看楼主
level 1
rg.htmlparser.util.ParserException: Exception getting input stream from http://dl.acm.org/results.cfm?query=2004&querydisp=2004&source_query=Owner%3AACM&start=1&srt=score%20dsc&short=0&source_disp=&since_month=&since_year=&before_month=&before_year=&coll=DL&dl=ACM&termshow=matchall&range_query=&CFID=95833508&CFTOKEN=18828427 (Server returned HTTP response code: 403 for URL: http://dl.acm.org/results.cfm?query=2004&querydisp=2004&source_query=Owner%3AACM&start=1&srt=score%20dsc&short=0&source_disp=&since_month=&since_year=&before_month=&before_year=&coll=DL&dl=ACM&termshow=matchall&range_query=&CFID=95833508&CFTOKEN=18828427).;java.io.IOException: Server returned HTTP response code: 403 for URL: http://dl.acm.org/results.cfm?query=2004&querydisp=2004&source_query=Owner%3AACM&start=1&srt=score%20dsc&short=0&source_disp=&since_month=&since_year=&before_month=&before_year=&coll=DL&dl=ACM&termshow=matchall&range_query=&CFID=95833508&CFTOKEN=18828427at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)at java.lang.reflect.Constructor.newInstance(Constructor.java:513)at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1360)at java.security.AccessController.doPrivileged(Native Method)at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1354)at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1008)at org.htmlparser.lexer.Page.setConnection(Page.java:570)at org.htmlparser.lexer.Page.<init>(Page.java:133)at org.htmlparser.lexer.Lexer.<init>(Lexer.java:185)at org.htmlparser.Parser.setResource(Parser.java:398)at org.htmlparser.Parser.<init>(Parser.java:317)at org.htmlparser.Parser.<init>(Parser.java:331)at HtmlParserTool.extracLinks(HtmlParserTool.java:18)at MyCrawler.crawling(MyCrawler.java:47)at MyCrawler.main(MyCrawler.java:68)Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://dl.acm.org/results.cfm?query=2004&querydisp=2004&source_query=Owner%3AACM&start=1&srt=score%20dsc&short=0&source_disp=&since_month=&since_year=&before_month=&before_year=&coll=DL&dl=ACM&termshow=matchall&range_query=&CFID=95833508&CFTOKEN=18828427at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1305)at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)at org.htmlparser.http.ConnectionManager.openConnection(ConnectionManager.java:652)at org.htmlparser.http.ConnectionManager.openConnection(ConnectionManager.java:840)... 6 more
2012年04月06日 07点04分 1
level 1
使用网上介绍的
URL url1 = new URL(url);
HttpURLConnection conn = (HttpURLConnection) url1.openConnection();
settingProxy();
conn.addRequestProperty("User-Agent", "Mozilla/4.76");
conn.connect();
方法并不好用
2012年04月06日 07点04分 2
level 1
同问题,求高手解答
2012年06月06日 08点06分 3
1