遇到一个比较棘手的需求:
开发语言Java;
程序定时读取HR邮箱中从前程无忧,智联发过来的简历(已实现,获到简历的HTML);
从简历HTML中解析获取想要的信息想(姓名,性别,电话,邮箱,工作经历,教育经历等等),保存到数据库中;
把数据库中的简历数据用HTML展示,可让HR进行筛选;
我现在卡在了简历HTML的解析信息这步,我用比较笨的方法,字符串定位截取,但是这样没办法比较准确的获取到想要信息。。。求助大家,看有没有好方法解析。。
PHPz2017-04-18 10:22:42
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/
怪我咯2017-04-18 10:22:42
What about using regular expressions? Think more about possible matching formats and it should be OK.
高洛峰2017-04-18 10:22:42
You can use JSOUP. I have done something similar before. This is very convenient and can process various tags and so on.
PHP中文网2017-04-18 10:22:42
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.
伊谢尔伦2017-04-18 10:22:42
1 Regular
2 HTML parsing library, it seems to be called "mithril" in Chinese