java - 解析HTML,获取其中想要的信息
巴扎黑
巴扎黑 2017-04-18 10:20:42
0
7
747

遇到一个比较棘手的需求:

  1. 开发语言Java;

  2. 程序定时读取HR邮箱中从前程无忧,智联发过来的简历(已实现,获到简历的HTML);

  3. 从简历HTML中解析获取想要的信息想(姓名,性别,电话,邮箱,工作经历,教育经历等等),保存到数据库中;

  4. 把数据库中的简历数据用HTML展示,可让HR进行筛选;

我现在卡在了简历HTML的解析信息这步,我用比较笨的方法,字符串定位截取,但是这样没办法比较准确的获取到想要信息。。。求助大家,看有没有好方法解析。。

巴扎黑
巴扎黑

reply all(7)
PHPzhong

It is better to use Jsoup to convert it into the corresponding Document object, which is more convenient when operating the corresponding elements.
jsoup API: http://www.open-open.com/jsoup/

刘奇

What about using regular expressions? Think more about possible matching formats and it should be OK.

Ty80

It would be better to use regular capture

巴扎黑

You can use jsoup

小葫芦

You can use JSOUP. I have done something similar before. This is very convenient and can process various tags and so on.

Ty80

Prefer jsoup.
jsoup has a select function, which is similar to the syntax of CSS selector. The API is simple and convenient than regular expressions.

伊谢尔伦

1 Regular
2 HTML parsing library, it seems to be called "mithril" in Chinese

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template