Toggle navigation
Toggle navigation
This project
Loading...
Sign in
방승일
/
mamuri-bot
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-13 23:31:27 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
31f26fb1a44016747013be2567b2f19509b3c1a1
31f26fb1
1 parent
8c76a26a
ADD: Dockerfile for chrome and selenium webdriver
FIX: session.FocusOnFrame error handling
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
joongna/service/item.go
joongna/service/item.go
View file @
31f26fb
...
...
@@ -86,7 +86,7 @@ func crawlingNaverCafe(cafeUrl string) (string, int, string, string) {
if
err
!=
nil
{
log
.
Println
(
err
)
}
desired
:=
webdriver
.
Capabilities
{
"Platform"
:
"
MacOS
"
}
desired
:=
webdriver
.
Capabilities
{
"Platform"
:
"
Linux
"
}
required
:=
webdriver
.
Capabilities
{}
session
,
err
:=
driver
.
NewSession
(
desired
,
required
)
if
err
!=
nil
{
...
...
@@ -97,7 +97,10 @@ func crawlingNaverCafe(cafeUrl string) (string, int, string, string) {
log
.
Println
(
err
)
}
time
.
Sleep
(
time
.
Second
*
1
)
session
.
FocusOnFrame
(
"cafe_main"
)
err
=
session
.
FocusOnFrame
(
"cafe_main"
)
if
err
!=
nil
{
log
.
Fatal
(
err
)
}
resp
,
err
:=
session
.
Source
()
html
,
err
:=
goquery
.
NewDocumentFromReader
(
bytes
.
NewReader
([]
byte
(
resp
)))
...
...
Please
register
or
login
to post a comment