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
Mai Hoang Thai Ha
VenJob
Commits
c0f80e93
Commit
c0f80e93
authored
Jul 28, 2021
by
Mai Hoang Thai Ha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
used start_with, next if empty field
parent
b8abb807
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletions
+2
-1
lib/tasks/web_crawler.rake
+2
-1
No files found.
lib/tasks/web_crawler.rake
View file @
c0f80e93
...
...
@@ -27,6 +27,7 @@ namespace :crawler do
job_page
=
Nokogiri
::
HTML
(
HTTParty
.
get
(
url
).
body
)
# Job
job_title
=
job_page
.
css
(
'div.job-desc h1.title'
).
text
next
if
job_title
.
nil?
# update_at, job_industries, job_type, salary, experience, level, expiration_date
detail_box_items
=
job_page
.
css
(
'.job-detail-content .detail-box ul li'
)
# init
...
...
@@ -121,7 +122,7 @@ namespace :crawler do
list_location
.
each
do
|
city
|
city_name
=
city
.
text
region
=
:international
if
city_name
.
include
?
(
'Việc làm tại'
)
if
city_name
.
start_with
?
(
'Việc làm tại'
)
city_name
=
city_name
.
remove
(
'Việc làm tại'
).
strip
region
=
:vietnam
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