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
0
Merge Requests
0
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
Nguyen Hoang Mai Phuong
VeNJOB
Commits
49fd4b09
Commit
49fd4b09
authored
Jul 23, 2021
by
Nguyen Hoang Mai Phuong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix crawler
parent
e080cf4f
Pipeline
#1362
failed with stages
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
db/migrate/20210720145646_change_jobs.rb
+3
-0
lib/tasks/crawler.rake
+1
-2
No files found.
db/migrate/20210720145646_change_jobs.rb
View file @
49fd4b09
class
ChangeJobs
<
ActiveRecord
::
Migration
[
6.1
]
def
up
change_column
:jobs
,
:experience
,
:string
change_column
:jobs
,
:salary
,
:string
rename_column
:jobs
,
:type
,
:job_type
end
def
down
change_column
:jobs
,
:experience
,
:integer
change_column
:jobs
,
:salary
,
:integer
end
end
lib/tasks/crawler.rake
View file @
49fd4b09
require
'open-uri'
require
'logger'
namespace
:crawler
do
desc
'Crawl Jobs and Companies'
...
...
@@ -47,7 +46,7 @@ namespace :crawler do
slug_job
=
CGI
.
escape
(
detail_jobs
.
css
(
'a.job_link'
).
attribute
(
'href'
).
text
.
gsub
(
'https://careerbuilder.vn/vi/tim-viec-lam/'
,
''
).
strip
)
job_detail_page
=
"https://careerbuilder.vn/vi/tim-viec-lam/
#{
slug_job
}
"
parse_job_detail_page
=
Nokogiri
::
HTML
(
URI
.
open
(
job_detail_page
)
.
read
)
parse_job_detail_page
=
Nokogiri
::
HTML
(
URI
.
open
(
job_detail_page
))
detail_job
=
parse_job_detail_page
.
css
(
'div.container'
)
title
=
detail_job
.
css
(
'div.job-desc h1.title'
)
next
if
title
.
nil?
...
...
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