Comments (3)
这个问题是因为如果使用tr,td但是没有table包围,不符合html规范,jsoup会自动做一个转换。这个问题正在想办法处理
from gecco.
我临时是这么处理的
public HtmlParser(String baseUri, String content) {
long beginTime = System.currentTimeMillis();
log = LogFactory.getLog(HtmlParser.class);
this.baseUri = baseUri;
if (StringUtils.startsWithAny(content, "<tr", "<tr ")) {
this.document = Jsoup.parse(content, baseUri, Parser.xmlParser());
} else {
this.document = Jsoup.parse(content, baseUri);
}
long endTime = System.currentTimeMillis();
if (log.isTraceEnabled()) {
log.trace("init html parser : " + (endTime - beginTime) + "ms");
}
}
from gecco.
已经解决,基本沿用你的思路,改成真正表达式。
from gecco.
Related Issues (20)
- 线程安全问题 HOT 2
- @Image图片下载优化 HOT 1
- Dependency org.mozilla:rhino, leading to CWE problem HOT 2
- Dependency org.apache.httpcomponents:httpclient, leading to CVE problem HOT 1
- DeriveSchedulerContext.into(pageRequest); 处理完成以后程序不停止 HOT 1
- 如何请求中加上cookie和header来模拟登录呢? HOT 1
- 挺好的项目,为什么不继续维护了呢,主站也停止运行了 HOT 1
- 链接失效了
- maven helper显示gecco 1.3.0依赖有冲突 HOT 1
- matchUrl目前是否可以使用正则匹配呢? HOT 1
- Pipeline之间如何优雅传值呢 HOT 1
- HtmlBean对象如何获取matchUrl参数变量?
- 希望Pipeline接口加入callback()方法
- 页面异步请求数据,返回json,但是post请求,如何处理。
- starts.json not found HOT 3
- 请问处理直接就是集合的json 应当怎么处理? HOT 1
- document.select("#read_$$deptleaderIdea") HOT 2
- 我要采集10个网站,可以为每个网站设置不同的thread线程数和时间间隔interval么? HOT 1
- 请问现在最新版本支持xpath吗? HOT 1
- 用gecco爬取app.mi.com会timeout,但是我用gecco自带的apache httpclient却没有这个问题 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gecco.