파이썬의 beatifulsoup4로 하려다가 자바유저니
안 써본 jsoup을 활용하여 크롤링 하려고 한다.
일단 공식 사이트에 들어가보자.
jsoup: Java HTML parser, built for HTML editing, cleaning, scraping, and XSS safety
jsoup: Java HTML Parser jsoup is a Java library for working with real-world HTML. It provides a very convenient API for fetching URLs and extracting and manipulating data, using the best of HTML5 DOM methods and CSS selectors. jsoup implements the WHATWG H
jsoup.org
Gradle에서 import하는 방법은 https://jsoup.org/download에 적혀있다.
Download and install jsoup
Download and install jsoup jsoup is available as a downloadable .jar java library. The current release version is 1.14.2. What's new See the 1.14.2 release announcement for the latest changes, or the changelog for the full history. Previous releases of jso
jsoup.org
https://github.com/jhy/jsoup/blob/master/src/main/java/org/jsoup/examples/Wikipedia.java
예제 Full code를 받아와 보았다.
http://en.wikipedia.org/ #mp-itn b a의 요소를 가져오는 모습을 볼 수 있다.
세세한 문법은 네이버 랭킹뉴스를 크롤링하면서 알아보도록 하자.
'프로젝트 정리 > 실시간 검색어 프로젝트' 카테고리의 다른 글
#6 Spring Security Guide (공식문서 보고 따라하기) (0) | 2021.09.01 |
---|---|
#5 프로젝트 구상 및 기획 ver.2 (0) | 2021.08.26 |
#4 Crwaling and Robots.txt (0) | 2021.08.26 |
#2 프로젝트 생성 (0) | 2021.08.25 |
#1 국내 핫이슈 프로젝트 구상 및 기획 (0) | 2021.05.19 |