Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이혜인
/
Multiplex_Ticketing_Platform
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
임승현
2022-06-06 01:22:06 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
27e2dd29aba1fb502638b997d67808f24f03b477
27e2dd29
1 parent
9a0633c0
Enable to load top19 movies
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
17 deletions
WebCrawling/src/CGVTicketing.js
WebCrawling/src/CGVTicketing.js
View file @
27e2dd2
...
...
@@ -77,40 +77,37 @@ async.waterfall([
"theater_name"
:
await
theater
.
getAttribute
(
'title'
),
"theater_code"
:
await
theater
.
getAttribute
(
'href'
)
//.replace("(.+(?<=theaterCode=))|(.+(?<=theatercode=))", "").substring(0,4)
};
theater_info
.
theater_code
=
theater_info
.
theater_code
.
replace
(
"(.+(?<=theaterCode=))|(.+(?<=theatercode=))"
,
""
).
substring
(
0
,
4
);
theater_info
.
theater_code
=
theater_info
.
theater_code
.
replace
(
/
(
.+
(?<
=theaterCode=
))
|
(
.+
(?<
=theatercode=
))
/
,
""
).
substring
(
0
,
4
);
theaters_info_by_area
.
push
(
theater_info
);
n
++
;
//console.log(theater_info);
}
cgv_theaters
.
push
(
theaters_info_by_area
);
}
console
.
log
(
n
);
driver_theaters
.
close
();
},
async
()
=>
{
const
driver_movies
=
new
webdriver
.
Builder
().
forBrowser
(
'chrome'
).
setChromeOptions
(
new
chrome
.
Options
().
headless
()).
build
();
driver_movies
.
get
(
url_movies
);
//예매율 Top19까지의 영화의 정보를 가져옴.
let
chart
=
await
driver_movies
.
wait
(
until
.
elementLocated
(
By
.
className
(
"sect-movie-chart"
)));
const
rank
=
chart
.
findElements
(
By
.
css
(
"strong.rank"
));
const
title
=
chart
.
findElements
(
By
.
css
(
"strong.title"
));
const
score
=
chart
.
findElements
(
By
.
css
(
"strong.percent"
));
const
GoldenEgg
=
chart
.
findElements
(
By
.
css
(
"span.percent"
));
const
link
=
chart
.
findElements
(
By
.
css
(
"a.plink-reservation"
));
//let chart = await driver_movies.wait(until.elementLocated(By.className("sect-movie-chart")));
const
rank
=
await
driver_movies
.
wait
(
until
.
elementsLocated
(
By
.
css
(
"strong.rank"
)));
const
title
=
await
driver_movies
.
wait
(
until
.
elementsLocated
(
By
.
css
(
"strong.title"
)));
const
score
=
await
driver_movies
.
wait
(
until
.
elementsLocated
(
By
.
css
(
"strong.percent"
)));
const
GoldenEgg
=
await
driver_movies
.
wait
(
until
.
elementsLocated
(
By
.
css
(
"span.percent"
)));
const
link
=
await
driver_movies
.
wait
(
until
.
elementsLocated
(
By
.
css
(
"a.link-reservation"
)));
//영화 제목, 순위, 예매율, 영화 코드, 골든에그 지수를 가져와 CGVMovieInfo 객체 생성자에 파라미터로 넘겨주고, 인스턴스를 받아옴.
for
(
let
i
=
0
;
i
<
rank
.
length
;
i
++
)
{
const
newTitle
=
title
[
i
]
;
const
newRank
=
parseInt
(
rank
[
i
].
replace
(
"No."
,
""
)
);
const
newScore
=
score
[
i
].
replace
(
"예매율"
,
""
).
replace
(
"%"
,
""
);
const
newCode
=
link
[
i
].
getAttribute
(
"href"
).
replace
((
"[^0-9]"
,
""
)).
substring
(
0
,
8
);
const
newMovie
=
new
CGVMovieInfo
(
newTitle
,
newRank
,
newScore
,
GoldenEgg
[
i
],
newCode
);
const
newTitle
=
await
title
[
i
].
getText
()
;
const
newRank
=
await
rank
[
i
].
getText
(
);
const
newScore
=
await
score
[
i
].
getText
(
);
const
newCode
=
await
link
[
i
].
getAttribute
(
"href"
);
const
newMovie
=
new
CGVMovieInfo
(
newTitle
,
parseInt
(
newRank
.
replace
(
"No."
,
""
)),
newScore
.
replace
(
"예매율"
,
""
).
replace
(
"%"
,
""
),
await
GoldenEgg
[
i
].
getText
(),
newCode
.
replace
(
/
[^
0-9
]
/
,
""
).
substring
(
0
,
8
)
);
cgv_movies
.
push
(
newMovie
);
}
driver_movies
.
close
();
}
])
;
])
app
.
get
(
'/cgv_theaters'
,
(
req
,
res
)
=>
{
res
.
send
(
cgv_theaters
[
0
]);
...
...
Please
register
or
login
to post a comment