Skip to content

Commit

Permalink
♻️ refactor: ChromeDriver 실행 방법 변경
Browse files Browse the repository at this point in the history
ChromeDriver 실행 방법을 변경하였습니다.
  • Loading branch information
seoshinehyo committed Feb 10, 2025
1 parent 5cd9dd1 commit 1f62f12
Showing 1 changed file with 0 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.net.URLEncoder;
Expand All @@ -22,9 +21,6 @@
@RequiredArgsConstructor
public class CrawlerService {

@Value("${webdriver.driver.chrome}") // yml에서 크롬 드라이버 경로 주입
private String chromeDriverPath;

public String getRandomImageUrl(String keyword) {

WebDriver driver = getWebDriver();
Expand Down Expand Up @@ -71,8 +67,6 @@ public String getRandomImageUrl(String keyword) {
}

private WebDriver getWebDriver() {
System.setProperty("webdriver.chrome.driver", chromeDriverPath);

ChromeOptions options = new ChromeOptions();
options.addArguments("--headless"); // 백그라운드 실행 (UI 렌더링 생략)
options.addArguments("--disable-gpu"); // GPU 사용 X
Expand Down

0 comments on commit 1f62f12

Please sign in to comment.