전체 글
-
[해커톤] 2023 SW중심대학 공동해커톤 후기해커톤 2023. 7. 13. 22:43
💻 SW 중심대학 공동해커톤이란? SW중심대학 사업에 참여하는 총 51개의 대학교를 대상으로 진행하는 해커톤이다. 각 대학마다 5명의 참여자(디자이너1명, 개발자4명)를 선정해 참여시키고, 서로 다른 대학교의 학생들과 팀을 결성하여 프로젝트를 진행한다. 📍 시작에 앞서 우리 대학교에서는 서류평가와 면접평가로 대상자를 모집했는데 나는 이번에 개발자로 참여하게 되었다. (5명 안에 뽑힌 것에 나름 뿌듯하달까...ㅎ) 오프라인으로 진행되고 방학 중 3일에 장소도 멀다보니 조금 고민을 했는데, 해커톤에 참여해본 적이 없어서 경험삼아 신청을 하게 되었다. 더불어 매일 우리학교 사람들과 프로젝트 하는 것에 조금 질려서 다른 대학교의 사람들과 프로젝트를 진행해보고 싶기도 했다. 결과적으로 아주 만족하는 경험!! 무엇..
-
[Spring] Spring에서 Selenium(셀레니움) 사용해 크롤링하기Backend/Spring 2023. 6. 14. 01:03
시작 Spring 프로젝트에서 크롤링을 하기위해 라이브러리를 찾던 중 JSoup과 Selenium을 발견했다. 나의 크롤링의 경우 단순히 긁어오는 것이 아니라 페이지 이동, 동작이 필요했는데 JSoup은 동적 웹페이지가 안되는 것 같았다. 그래서 Selenium으로 결정했다. 크롬을 가장 많이 사용하는 것 같아 크롬브라우저를 사용할 것이다. 크롬 브라우저 버전 확인 크롬 브라우저에 접속하여 메뉴 → 설정 → Chrome정보 에서 크롬 버전을 확인할 수 있다. 크롬 드라이버 설치 다음 링크에서 크롬 브라우저 버전에 맞는 드라이버를 설치한다. ChromeDriver - WebDriver for Chrome - Downloads Current Releases If you are using Chrome vers..
-
[Spring] 우분투 서버에서 Docker로 Selenium 환경 구축하기Backend/Spring 2023. 6. 14. 00:39
시작 Spring 프로젝트에서 Selenium을 사용해 크롤링을 구현했다. 로컬에서 잘 돌아가던 코드가 서버에서 안돌아가는 경우가 많지만 Selenium은 정말정말 에러도 많고 구축하기 어려웠다. 그 과정을 정리해보려고 한다! ⚙ 개발환경 GCP 인스턴스 리눅스 우분투 18.04 JDK 17 Gradle Spring Boot 구조 Selenium을 사용하기 위해선 크롬과 크롬드라이버가 필요하다. 특히 이 둘의 버전을 맞춰서 설치해주어야 한다. Command Line으로 서버에 설치하는 방법도 있겠지만 Dockerfile에 명령어를 작성해두는 것을 선택했다. Dockerfile을 통해 크롬과 크롬드라이버를 설치하고 컨테이너에 설치된 드라이버를 selenium에서 사용할 수 있도록 할 것이다. 📌과정 Doc..
-
[Docker] Docker Compose를 사용하여 Spring 컨테이너와 로컬 MySQL 연결하기Backend/Docker 2023. 6. 13. 20:30
시작 Spring 프로젝트를 진행하면서 초기에는 도커없이 서버에서 로컬로 mysql과 스프링을 연결했다. 하지만 이후 도커 적용이 필요해지면서 dockerfile과 docker-compose.yml 파일을 작성했다. 이때 대부분 MySQL도 컨테이너로 생성해 스프링 컨테이너와 연결하는데, 나의 경우 로컬에서 사용하던 DB를 계속사용해야 했기 때문에 스프링 컨테이너와 로컬 MySQL을 연결해야했다. Spring Dockerfile Dockerfile의 경우 프로젝트에서 사용하는 jdk를 지정하고 gradle을 통해 build된 jar 파일을 컨테이너에 포함시켜 jar파일을 실행시킨다. 여기서 중요한 점은 대부분 파일 경로 상 docker-compose.yml 밑에 Dockerfile이 존재하게 되는데 Do..
-
[Spring Error] Java로 Selenium(셀레니움)을 사용해 크롤링 시 Unable to establish websocket connection to 에러Backend/Spring 2023. 6. 13. 20:06
문제 스프링부트 프로젝트에서 크롤링을 하기 위해서 셀레니움 라이브러리를 사용했다. 동작 시 다음과 같이 웹소켓과 연결할 수 없다는 에러가 발생했다. 더보기 org.openqa.selenium.remote.http.ConnectionFailedException: Unable to establish websocket connection to 해결 방법 chromedriver 생성시에 ChromeOption을 포함할 수 있는데 다음 코드를 포함하면 된다. ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.addArguments("--remote-allow-origins=*"); ChromeDriver driver = new ChromeDrive..