Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ShinSeungMin
/
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-05-27 23:20:23 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a5d4af656aaac1008b034fd48025fbf197007c57
a5d4af65
1 parent
02e2796a
adding movie info
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
Megabox_crawling/app.js
Megabox_crawling/app.js
View file @
a5d4af6
...
...
@@ -17,6 +17,23 @@ let movie_data = [];
(
async
()
=>
{
const
driver
=
new
webdriver
.
Builder
().
forBrowser
(
'chrome'
).
build
();
driver
.
get
(
booking_url
);
driver
.
switchTo
().
frame
(
0
)
//frameBokdMBooking 프레임 가져옴
let
list
=
await
driver
.
wait
(
until
.
elementsLocated
(
By
.
css
(
'#mCSB_1_container>ul>li>.btn'
)));
r
=
0
;
for
(
item
of
list
)
{
//Using getAttribute to get the data
movie_data
[
r
++
]
=
{
'rank'
:
r
,
'title'
:
await
item
.
getAttribute
(
"movie-nm"
),
'movie_num'
:
await
item
.
getAttribute
(
"movie-no"
),
'running'
:
await
item
.
getAttribute
(
"form-at"
),
}
}
driver
.
close
();
r
=
0
;
const
browser
=
await
puppeteer
.
launch
({
headless
:
true
...
...
@@ -31,6 +48,11 @@ let movie_data = [];
const
name
=
$
(
list
).
find
(
'div.tit-area > p.tit'
).
attr
(
'title'
);
const
rate
=
$
(
list
).
find
(
'div.rate-date > span.rate'
).
text
();
if
(
movie_data
[
r
].
title
===
name
){
movie_data
[
r
][
'rate'
]
=
rate
;
}
else
{
movie_data
[
r
][
'rate'
]
=
'예매율 0.0%'
;
}
});
r
=
0
;
for
(
i
of
movie_data
){
...
...
@@ -40,6 +62,11 @@ let movie_data = [];
browser
.
close
();
})();
// (async () => {
// })();
...
...
Please
register
or
login
to post a comment