Toggle navigation
Toggle navigation
This project
Loading...
Sign in
강상위
/
my-broadcasting
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
김승훈
2018-12-11 13:03:39 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6c3513dffefb706c99672868d58bfcd9c0770d48
6c3513df
1 parent
94bae4d0
동명이인
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
0 deletions
동명이인/sdfasdfasd.js
동명이인/sdfasdfasd.js
0 → 100644
View file @
6c3513d
var
async
=
require
(
'async'
);
var
webdriver
=
require
(
'selenium-webdriver'
);
//var options = {desiredCapabilities: {browserName: 'chrome'}};
var
chrome
=
require
(
'selenium-webdriver/chrome'
)
var
Options
=
new
chrome
.
Options
();
Options
.
addArguments
(
'headless'
)
Options
.
addArguments
(
'disable-gpu'
)
var
test1
=
require
(
'./crawling_samename'
)
const
fs
=
require
(
'fs'
)
var
util
=
require
(
'util'
)
var
EventEmitter
=
require
(
'events'
).
EventEmitter
;
var
next_link_Array
=
[]
var
img_src_Array
=
[]
const
{
Builder
,
By
,
Key
,
until
}
=
require
(
'selenium-webdriver'
);
var
driver
=
new
webdriver
.
Builder
()
.
forBrowser
(
'chrome'
)
.
withCapabilities
(
webdriver
.
Capabilities
.
chrome
())
.
setChromeOptions
(
Options
)
.
build
();
var
First_Search
=
function
(
name
)
{
var
self
=
this
;
this
.
on
(
'input'
,
function
()
{
if
(
fs
.
existsSync
(
"./log/"
+
name
+
"_next_link.txt"
))
{
const
next_link
=
fs
.
readFileSync
(
"./log/"
+
name
+
"_next_link.txt"
);
const
img_src
=
fs
.
readFileSync
(
"./log/"
+
name
+
"_img_src.txt"
);
next_link_Array
=
next_link
.
toString
().
split
(
','
);
img_src_Array
=
img_src
.
toString
().
split
(
','
);
driver
.
quit
()
console
.
log
(
next_link_Array
)
console
.
log
(
img_src_Array
)
setTimeout
(
function
()
{
br_search
.
emit
(
'click'
)
},
1000
)
}
else
{
test1
.
first_search
(
driver
,
name
,
function
()
{
const
next_link
=
fs
.
readFileSync
(
"./log/"
+
name
+
"_next_link.txt"
);
const
img_src
=
fs
.
readFileSync
(
"./log/"
+
name
+
"_img_src.txt"
);
next_link_Array
=
next_link
.
toString
().
split
(
','
);
img_src_Array
=
img_src
.
toString
().
split
(
','
);
br_search
=
new
broadcasting_search
(
next_link_Array
,
"유재석"
,
0
)
console
.
log
(
next_link_Array
)
console
.
log
(
img_src_Array
)
driver
.
quit
()
setTimeout
(
function
()
{
br_search
.
emit
(
'click'
)
},
1000
)
})
}
})
}
util
.
inherits
(
First_Search
,
EventEmitter
);
first_search1
=
new
First_Search
(
"유재석"
)
first_search1
.
emit
(
'input'
)
Please
register
or
login
to post a comment