Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VenJob
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Đường Sỹ Hoàng
VenJob
Commits
db5fb9fa
Commit
db5fb9fa
authored
Dec 06, 2019
by
Đường Sỹ Hoàng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed rail logger
parent
9711ba07
Pipeline
#252
failed with stages
in 0 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
config/environment.rb
+0
-2
lib/tasks/job.rake
+3
-3
No files found.
config/environment.rb
View file @
db5fb9fa
...
@@ -3,5 +3,3 @@ require_relative "application"
...
@@ -3,5 +3,3 @@ require_relative "application"
# Initialize the Rails application.
# Initialize the Rails application.
Rails
.
application
.
initialize!
Rails
.
application
.
initialize!
Rails
.
logger
=
Logger
.
new
(
STDOUT
)
config
.
logger
=
ActiveSupport
::
Logger
.
new
(
"log/
#{
Rails
.
env
}
.log"
)
lib/tasks/job.rake
View file @
db5fb9fa
...
@@ -6,7 +6,7 @@ require "pry"
...
@@ -6,7 +6,7 @@ require "pry"
namespace
:job
do
namespace
:job
do
desc
"crawl data"
desc
"crawl data"
task
cr
eate
: :environment
do
task
cr
awl
: :environment
do
agent
=
Mechanize
.
new
agent
=
Mechanize
.
new
main_page
=
Nokogiri
::
HTML
(
open
(
URI
.
escape
(
"https://careerbuilder.vn/viec-lam/tat-ca-viec-lam-trang-vi.html"
)))
main_page
=
Nokogiri
::
HTML
(
open
(
URI
.
escape
(
"https://careerbuilder.vn/viec-lam/tat-ca-viec-lam-trang-vi.html"
)))
total_page
=
main_page
.
css
(
"div.ais-stats"
).
css
(
"h1.col-sm-10"
).
css
(
"span"
).
text
.
to_i
total_page
=
main_page
.
css
(
"div.ais-stats"
).
css
(
"h1.col-sm-10"
).
css
(
"span"
).
text
.
to_i
...
@@ -38,8 +38,8 @@ namespace :job do
...
@@ -38,8 +38,8 @@ namespace :job do
position
=
job_page
.
css
(
"div#showScroll.box2Detail"
).
css
(
"ul.DetailJobNew"
).
css
(
"li.bgLine1"
).
css
(
"p.fl_left"
).
text
position
=
job_page
.
css
(
"div#showScroll.box2Detail"
).
css
(
"ul.DetailJobNew"
).
css
(
"li.bgLine1"
).
css
(
"p.fl_left"
).
text
rescue
rescue
logger
=
Rails
.
logger
crawler_logger
=
ActiveSupport
::
Logger
.
new
(
"log/crawler.log"
)
logger
.
info
"Skip
#{
link
}
"
crawler_
logger
.
info
"Skip
#{
link
}
"
next
next
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment