Get web site source code
public String getPageSource() {
StringBuffer sb = new StringBuffer();
try {
// 构建一URL对象
URL url = new URL(pageUrl);
// 使用openStream得到一输入流并由此构造一个BufferedReader对象
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream(), pageEncode));
String line;
// 读取www资源
while ((line = in.readLine()) != null) {
sb.append(line);
}
in.close();
} catch (Exception ex) {
System.err.println(ex);
}
return sb.toString();
}
Get web site source code的更多相关文章
- Web site collections
Integration 伯乐在线 极客头条 Hacker News Stack Overflow RFC Search Security Python Hacker - Freebuf PrimalS ...
- Best Practices for Speeding Up Your Web Site
The Exceptional Performance team has identified a number of best practices for making web pages fast ...
- Drupal与大型网站架构(译)- Large-Scale Web Site Infrastructure and Drupal
Drupal与大型网站架构(译)- Large-Scale Web Site Infrastructure and Drupal Linuxjournal 网站经典文章翻译,原文地址: Large-S ...
- [转载]Best Practices for Speeding Up Your Web Site
原文:http://developer.yahoo.com/performance/rules.html 提升网站加载速度的一些优化技巧,大部分在前端层面. 不知道是多久以前写的,看起来有些已经过时了 ...
- 走进云背后:微软Azure web 项目通过web service部署web site
探索云那不为人知的故事(一):Web Services部署web site 前奏:Windows Azure是微软基于云计算的操作系统,现在更名为“Microsoft Azure”,和Azure Se ...
- [解决]ASP.NET MVC 4/5 源码调试(source code debug)
========================ASP.NET MVC 4============================ ASP.NET MVC 4 source code download ...
- XML.ObjTree -- XML source code from/to JavaScript object like E4X
转载于:http://www.kawa.net/works/js/xml/objtree-try-e.html // ========================================= ...
- Learning from the CakePHP source code - Part I
最近开始痛定思痛,研究cakephp的源码. 成长的路上从来没有捷径,没有小聪明. 只有傻傻的努力,你才能听到到成长的声音. 下面这篇文章虽然过时了,但是还是可以看到作者的精神,仿佛与作者隔着时空的交 ...
- Source Code Review
1.berfore we talking abnout the Source Code review,here's what we want to know about the most popula ...
随机推荐
- pipenv虚拟环境使用方法
1.打开cmd安装pipenv, pip install pipenv 2.新建工程目录,项目目录,然后cmd进入工程目录 基本命令: pipenv install ...
- jvm监控工具jconsole进行远程监控配置
[环境] SUSE linux11 + jdk1.6 + tomcat7 [场景] 最近在做性能测试,想通过我本地(win7)上的jdk来远程监控上述服务器的jvm相关信息. [配置] 配置上述服务器 ...
- 详解python中的描述符
描述符介绍 总所周知,python声明变量的时候,不需要指定类型.虽然现在有了注解,但这只是一个规范,在语法层面是无效的.比如: 这里我们定义了一个hello函数,我们要求name参数传入str类型的 ...
- centos7初始化bashshell脚本
centos7初始化bashshell脚本 #!/bin/bash if [[ "$(whoami)" != "root" ]]; then echo &quo ...
- bootstap 表格自动换行 截取超长数据
<table class="table" style="TABLE-LAYOUT:fixed;WORD-WRAP:break_word">
- MFC的一些常用操作
一.添加消息 MFC和win32不同的一点是MFC采用的是消息的映射机制,即每一个消息都和处理的函数做了映射,我们可以通过查找的方式来得到消息的对应的函数,当然MFC提供了一个非常简便的方法,我们通过 ...
- JAVA 从打包成jar到导入到IntelliJ IDEA使用
一. 使用常用命令打包: jar -cvf 目标jar包名称 待打包路径 例:jar -cvf myjar.jar com/dn/Demo 二. 打开IntelliJ IDEA (2017.2版本) ...
- Problem C Shopping 闭环贪心
#include <bits/stdc++.h> using namespace std; ; int fa[maxn]; int main(){ int n, m; scanf(&quo ...
- Django:报错 raise MigrationSchemaMissing("Unable to create the django_migrations table (%s)" % exc)
Django 执行迁移生成表: python manage.py migrate 报错: raise MigrationSchemaMissing("Unable to create the ...
- LeetCode 69 x 的平方根
链接:https://leetcode-cn.com/problems/sqrtx 实现 int sqrt(int x) 函数. 计算并返回 x 的平方根,其中 x 是非负整数. 由于返回类型是整数, ...