linux 爬虫总结 读取poj data
来源:互联网 发布:东方网络 编辑:程序博客网 时间:2024/06/11 21:43
import java.net.*;import java.io.*;public class urlconnection{public static void main(String[] args){StringBuffer document = new StringBuffer();try{URL url = new URL("http://poj.org/problem?id=1011");//poj idURLConnection conn = url.openConnection();BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));String line = null;while ((line = reader.readLine()) != null)document.append(line + "\n");reader.close();}catch (MalformedURLException e){e.printStackTrace();}catch (IOException e){e.printStackTrace();}String begin = document.toString().split("Sample Input</p><pre class=")[1];begin.replaceAll("\"", "o");begin = begin.substring(6);String end = begin.split(">Sample Output</p>")[0];//</pre><p class=end = end.split("</pre><p class=")[0];System.out.println(end);}}
http://www.blogjava.net/Martin-Liu-Hai-Shi/articles/214615.html
java 实现http://usejava.iteye.com/blog/724177
python:简单有效实现http://www.lovelucy.info/python-crawl-pages.html
http://blog.csdn.net/ithomer/article/details/7626929这篇博客可以设置代理进行爬虫下载
知识拓展:
在国内,由于某种原因一般难以直接访问国外某些敏感网站,需要通过 VPN 或 代理服务器才能访问
如果校园网和教育网有IPv6,则可以通过sixxs.org免费代理访问facebook、twitter、六维空间等网站
其实,除了VPN 和 IPv6+sixxs.org代理方式外,普通用户还是有其它途径访问到国外网站
下面介绍两个著名的免费代理网站:
freeproxylists.net(全球数十个国家的免费代理,每日都更新)
xroxy.com(通过设置端口类型、代理类型、国家名称进行筛选)
curl 项目实例
使用curl + freeproxylists.net免费代理,实现了全球12国家google play游戏排名的网页抓取以及趋势图查询(抓取网页模块全部使用Shell编写,核心代码约1000行)
游戏排名趋势图请见我先前的博客:JFreeChart项目实例
java爬虫例子:http://blog.csdn.net/ithomer/article/details/6916506
linux shell:http://blog.csdn.net/ithomer/article/details/7635301
- linux 爬虫总结 读取poj data
- 爬虫总结
- 爬虫总结
- 爬虫总结
- 读取data数据
- <meta-data>读取方法
- 爬虫总结(四)-- 分布式爬虫
- linux data
- Socket data事件和data读取测试
- POJ 1044 Data bugs
- Linux shell 读取一个data文件,扫描其中的一个内容
- 读取总结
- 高考爬虫总结
- python爬虫技术总结
- java网络爬虫-总结
- python爬虫问题总结
- python 爬虫总结(一)
- Python爬虫技巧总结
- CUDA: Windows 7 64位环境安装及配置
- 几种任务调度的 Java 实现方法与比较
- Java反编译器 Java Decompiler
- Wamp集成环境 PHPStorm+Xdebug调试代码
- 【子串和 44 动态规划】
- linux 爬虫总结 读取poj data
- 安装两个数据库
- poj 3167 Cow Bowling【dp】
- GetTextMetrics与GetTextExtent的区别
- android ,Tabhost,tab 动态刷新,onResume
- 2014----微软校招
- 【捡肥皂】,sql挂起清除工具 MS SQL2000挂起工具,无毒绿色,MSSQL手动清除挂起方法
- 解决"Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
- [剑指offer][面试题16]反转链表