paip.抓取网页内容--java php python.txt
作者Attilax 艾龙, EMAIL:1466519819@qq.com
来源:attilax的专栏
地址:http://blog.csdn.net/attilax
//////////java
String urlContent = WebpageContent("http://www.123cha.com/ip/?q="+ip,"utf-8");
///////////php
file_get_contents($url);
curl_init()>>>curl_exec
fopen->fread->fclose
/////python
urllib.urlopen(url).read()
response = urllib2.urlopen(‘http://www.baidu.com/‘)
html = response.read()
///ahk
UrlDownloadToFile, URL, Filename
public String downloadPage(String Url, String encode) {
try {
URL pageUrl = new URL(Url);
// Open connection to URL for reading.
BufferedReader reader = new BufferedReader(new InputStreamReader(
pageUrl.openStream(), encode));
// BufferedReader br = new BufferedReader(new InputStreamReader(in,
// "gbk"));
// Read page into buffer.
String line;
StringBuffer pageBuffer = new StringBuffer();
while ((line = reader.readLine()) != null) {
pageBuffer.append(line);
}
String s = pageBuffer.toString();
return s;
// System.out.println(s);
// return pageBuffer.toString();
} catch (Exception e) {
// return null;
throw new RuntimeException(e);
}
}
参考:
php获取网页内容方法总结_php技巧_脚本之家.htm
Python 3 抓取网页资源的 N 种方法.htm
相关文章
- 10-15利用Crowbar抓取网页异步加载的内容 [Python俱乐部]
- 10-15Java 抓取网页中的内容【持续更新】
- 10-15php抓取网页中的内容
- 10-15paip.文件目录操作uAPI php python java对照
- 10-15paip.判断文件是否存在uapi python php java c#
- 10-15paip.数组以及集合的操作uapi java php python总结..
- 10-15paip.执行shell cmd 命令uapi java php python总结
- 10-15java – 使用Nutch如何抓取ujng ajax的网页的动态内容?
- 10-15paip.字符串操作uapi java php python总结..
- 10-15PHP 抓取网页内容的几个函数