Showing
2 changed files
with
4 additions
and
3 deletions
No preview for this file type
... | @@ -83,7 +83,7 @@ public class CGVExample { | ... | @@ -83,7 +83,7 @@ public class CGVExample { |
83 | public static void main(String[] args) { | 83 | public static void main(String[] args) { |
84 | Scanner scanner = new Scanner(System.in); | 84 | Scanner scanner = new Scanner(System.in); |
85 | String url = "https://www.cgv.co.kr/movies/?lt=1&ft=1"; //끝의 쿼리 0은 개봉 전 영화도 포함하는 것. | 85 | String url = "https://www.cgv.co.kr/movies/?lt=1&ft=1"; //끝의 쿼리 0은 개봉 전 영화도 포함하는 것. |
86 | - Document doc = null; | 86 | + Document doc; |
87 | ArrayList<CGVMovieInfo> Movies = new ArrayList<>(); | 87 | ArrayList<CGVMovieInfo> Movies = new ArrayList<>(); |
88 | try { | 88 | try { |
89 | doc = Jsoup.connect(url).get(); | 89 | doc = Jsoup.connect(url).get(); |
... | @@ -112,10 +112,11 @@ public class CGVExample { | ... | @@ -112,10 +112,11 @@ public class CGVExample { |
112 | } | 112 | } |
113 | 113 | ||
114 | for (CGVMovieInfo elem : Movies) { | 114 | for (CGVMovieInfo elem : Movies) { |
115 | - System.out.println(elem.getRank() + " : " + elem.getTitle()); | 115 | + elem.printMovieInfo(); |
116 | + //System.out.println(elem.getRank() + " : " + elem.getTitle()); | ||
116 | } | 117 | } |
117 | 118 | ||
118 | - System.out.print("관람하고 싶은 영화의 순위를 입력하세요 : "); | 119 | + System.out.print("예매하고 싶은 영화의 순위를 입력하세요 : "); |
119 | int inputRank = scanner.nextInt(); | 120 | int inputRank = scanner.nextInt(); |
120 | try{ | 121 | try{ |
121 | Desktop.getDesktop().browse(new URI(Movies.get(inputRank - 1).getLink())); | 122 | Desktop.getDesktop().browse(new URI(Movies.get(inputRank - 1).getLink())); | ... | ... |
-
Please register or login to post a comment