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-06 20:38:47 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9ad7029f263fa478979bc828f7b2536e5f79ada9
9ad7029f
1 parent
318db7a2
add crawling_samename_person
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
0 deletions
crawling_samename.js
crawling_samename.js
0 → 100644
View file @
9ad7029
var
async
=
require
(
'async'
);
var
webdriver
=
require
(
'selenium-webdriver'
);
var
options
=
{
desiredCapabilities
:
{
browserName
:
'chrome'
}};
var
JASON
=
require
(
'jason'
)
const
{
Builder
,
By
,
Key
,
until
}
=
require
(
'selenium-webdriver'
);
var
ajason
=
new
Object
()
var
aname
=
[]
var
asrc
=
[]
var
alink
=
[]
var
driver
=
new
webdriver
.
Builder
().
withCapabilities
(
webdriver
.
Capabilities
.
chrome
()).
build
();
let
url1
=
"https://people.search.naver.com/search.naver?sm=sbx_hty&where=nexearch&ie=utf8&query=%EC%9C%A0%EC%9E%AC%EC%84%9D&x=0&y=0"
driver
.
get
(
url1
).
then
(()
=>
{
driver
.
findElements
(
webdriver
.
By
.
className
(
'result_profile'
))
.
then
(
whoclasses
=>
{
whoclasses
.
forEach
(
whoclass
=>
{
whoclass
.
findElements
(
webdriver
.
By
.
className
(
'thmb'
))
.
then
(
img_thmbs
=>
{
img_thmbs
.
forEach
(
img_thmb
=>
{
img_thmb
.
findElements
(
webdriver
.
By
.
className
(
'thmb_img'
)).
then
(
img_src
=>
{
img_src
[
0
].
getAttribute
(
"src"
)
.
then
(
src
=>
{
if
(
src
)
{
asrc
.
push
(
src
)
}
else
{
asrc
.
push
(
"none"
)
}
}).
then
(()
=>
{
console
.
log
(
asrc
,
alink
,
aname
)
})
})
})
whoclass
.
findElements
(
webdriver
.
By
.
tagName
(
"strong"
))
.
then
(
name_temp
=>
{
name_temp
[
0
].
getText
().
then
(
name
=>
{
aname
.
push
(
name
)
})
})
})
whoclass
.
findElements
(
webdriver
.
By
.
className
(
'who'
))
.
then
(
who
=>
{
who
[
0
].
findElements
(
webdriver
.
By
.
className
(
'name'
))
.
then
(
findname
=>
{
findname
[
0
].
getAttribute
(
"href"
)
.
then
(
link
=>
{
alink
.
push
(
link
)
})
})
})
})
})
})
\ No newline at end of file
Please
register
or
login
to post a comment