Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
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
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Nguyen Hoang Mai Phuong
  • VeNJOB
  • Merge Requests
  • !2

Merged
Opened Jul 15, 2021 by Nguyen Hoang Mai Phuong@phuongnhm 
  • Report abuse
Report abuse

Create crawler

×

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b crawler origin/crawler

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git checkout master
git merge --no-ff crawler

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 33
  • Commits 15
  • Pipelines 14
  • Changes 21
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Nguyen Hoang Mai Phuong @phuongnhm

    added 1 commit

    • fef9193c - fix crawler

    Compare with previous version

    Jul 16, 2021

    added 1 commit

    • fef9193c - fix crawler

    Compare with previous version

    added 1 commit * fef9193c - fix crawler [Compare with previous version](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5326&start_sha=bcb0e40992006f65c42e61cdd56a62ba76582a60)
    Toggle commit list
  • Nguyen Hoang Mai Phuong @phuongnhm

    added 1 commit

    • 20dff5d8 - create crawler with rake task

    Compare with previous version

    Jul 19, 2021

    added 1 commit

    • 20dff5d8 - create crawler with rake task

    Compare with previous version

    added 1 commit * 20dff5d8 - create crawler with rake task [Compare with previous version](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5327&start_sha=fef9193c5c4b8db8d5e1a8ebb86e99707422dae5)
    Toggle commit list
  • Nguyen Hoang Mai Phuong @phuongnhm

    added 1 commit

    • 4bfb13bf - import data

    Compare with previous version

    Jul 19, 2021

    added 1 commit

    • 4bfb13bf - import data

    Compare with previous version

    added 1 commit * 4bfb13bf - import data [Compare with previous version](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5330&start_sha=20dff5d84eb5c1aa1351e97dcfdbe5751321688b)
    Toggle commit list
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 20, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 20, 2021
    craw.rb 0 → 100644
    1 require 'nokogiri'
    • Thanh Hung Pham @hungpt commented Jul 20, 2021
      Master

      @phuongnhm remove file này nha em.

      @phuongnhm remove file này nha em.
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 5 of the diff

      Jul 21, 2021

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5343&start_sha=4bfb13bfe55dda4d7fd49804369162a57610bfde#360a1c2df9df23a1d8aa5a4e3b09b16306eee550_1_0)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on the diff Jul 20, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 20, 2021
    lib/tasks/crawler.rake 0 → 100644
    1 require 'open-uri'
    2 namespace :crawler do
    • Thanh Hung Pham @hungpt commented Jul 20, 2021
      Master

      @phuongnhm add new line.

      @phuongnhm add new line.
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 20, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 21, 2021
    lib/tasks/crawler.rake 0 → 100644
    1 require 'open-uri'
    2 namespace :crawler do
    3 desc "TODO"
    • Thanh Hung Pham @hungpt commented Jul 20, 2021
      Master

      @phuongnhm Ghi gõ ra chức năng của task

      @phuongnhm Ghi gõ ra chức năng của task
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 5 of the diff

      Jul 21, 2021

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5343&start_sha=4bfb13bfe55dda4d7fd49804369162a57610bfde#b321b772986de9dfe9db0ed4138ae166e577f241_3_4)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 20, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 22, 2021
    lib/tasks/crawler.rake 0 → 100644
    1 require 'open-uri'
    2 namespace :crawler do
    3 desc "TODO"
    4 task jobs: :environment do
    5 base_url = Nokogiri::HTML(URI.open('https://careerbuilder.vn/'))
    6 list_url = base_url.css('div.menu div.dropdown-menu ul li a')[0].attributes["href"].value
    • Thanh Hung Pham @hungpt commented Jul 20, 2021
      Master

      @phuongnhm Sửa lại tên biến cho rõ ràng, dể hiểu nha em.

      @phuongnhm Sửa lại tên biến cho rõ ràng, dể hiểu nha em.
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 5 of the diff

      Jul 21, 2021

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5343&start_sha=4bfb13bfe55dda4d7fd49804369162a57610bfde#b321b772986de9dfe9db0ed4138ae166e577f241_6_7)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 20, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 21, 2021
    lib/tasks/crawler.rake 0 → 100644
    1 require 'open-uri'
    2 namespace :crawler do
    3 desc "TODO"
    4 task jobs: :environment do
    5 base_url = Nokogiri::HTML(URI.open('https://careerbuilder.vn/'))
    6 list_url = base_url.css('div.menu div.dropdown-menu ul li a')[0].attributes["href"].value
    7 parse_list_url = Nokogiri::HTML(URI.open(list_url))
    8 job_listing = parse_list_url.css('div.job-item')
    9 page = 1
    10 per_page = job_listing.length
    • Thanh Hung Pham @hungpt commented Jul 20, 2021
      Master

      @phuongnhm Nên check job_listing có bị nil hay không. per_page = job_listing.present? job_listing.length : 0

      @phuongnhm Nên check `job_listing` có bị nil hay không. `per_page = job_listing.present? job_listing.length : 0`
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 5 of the diff

      Jul 21, 2021

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5343&start_sha=4bfb13bfe55dda4d7fd49804369162a57610bfde#b321b772986de9dfe9db0ed4138ae166e577f241_10_11)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 20, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 22, 2021
    lib/tasks/crawler.rake 0 → 100644
    1 require 'open-uri'
    2 namespace :crawler do
    3 desc "TODO"
    4 task jobs: :environment do
    5 base_url = Nokogiri::HTML(URI.open('https://careerbuilder.vn/'))
    6 list_url = base_url.css('div.menu div.dropdown-menu ul li a')[0].attributes["href"].value
    7 parse_list_url = Nokogiri::HTML(URI.open(list_url))
    8 job_listing = parse_list_url.css('div.job-item')
    9 page = 1
    10 per_page = job_listing.length
    11 total = parse_list_url.css('div.job-found p').text.split(' ')[0].gsub(',','').to_i
    12 last_page = (total.to_f / per_page.to_f).round
    13 while page <= last_page
    14 pagination_list_url = "https://careerbuilder.vn/viec-lam/tat-ca-viec-lam-trang-#{page}-vi.html"
    15 parse_list_url = Nokogiri::HTML(URI.open(pagination_list_url))
    16 pagination_job_listing = parse_list_url.css('div.job-item')
    • Thanh Hung Pham @hungpt commented Jul 20, 2021
      Master

      @phuongnhm Kiểm tra next if pagination_job_listing.nil? next qua luôn vòng while

      @phuongnhm Kiểm tra `next if pagination_job_listing.nil?` next qua luôn vòng while
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 5 of the diff

      Jul 21, 2021

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5343&start_sha=4bfb13bfe55dda4d7fd49804369162a57610bfde#b321b772986de9dfe9db0ed4138ae166e577f241_16_16)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 20, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 20, 2021
    lib/tasks/crawler.rake 0 → 100644
    1 require 'open-uri'
    2 namespace :crawler do
    3 desc "TODO"
    4 task jobs: :environment do
    5 base_url = Nokogiri::HTML(URI.open('https://careerbuilder.vn/'))
    6 list_url = base_url.css('div.menu div.dropdown-menu ul li a')[0].attributes["href"].value
    7 parse_list_url = Nokogiri::HTML(URI.open(list_url))
    8 job_listing = parse_list_url.css('div.job-item')
    9 page = 1
    10 per_page = job_listing.length
    11 total = parse_list_url.css('div.job-found p').text.split(' ')[0].gsub(',','').to_i
    12 last_page = (total.to_f / per_page.to_f).round
    • Thanh Hung Pham @hungpt commented Jul 20, 2021
      Master

      @phuongnhm Fix rubocop check

      @phuongnhm Fix rubocop check
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 5 of the diff

      Jul 21, 2021

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5343&start_sha=4bfb13bfe55dda4d7fd49804369162a57610bfde#b321b772986de9dfe9db0ed4138ae166e577f241_12_11)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 20, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 21, 2021
    lib/tasks/crawler.rake 0 → 100644
    3 desc "TODO"
    4 task jobs: :environment do
    5 base_url = Nokogiri::HTML(URI.open('https://careerbuilder.vn/'))
    6 list_url = base_url.css('div.menu div.dropdown-menu ul li a')[0].attributes["href"].value
    7 parse_list_url = Nokogiri::HTML(URI.open(list_url))
    8 job_listing = parse_list_url.css('div.job-item')
    9 page = 1
    10 per_page = job_listing.length
    11 total = parse_list_url.css('div.job-found p').text.split(' ')[0].gsub(',','').to_i
    12 last_page = (total.to_f / per_page.to_f).round
    13 while page <= last_page
    14 pagination_list_url = "https://careerbuilder.vn/viec-lam/tat-ca-viec-lam-trang-#{page}-vi.html"
    15 parse_list_url = Nokogiri::HTML(URI.open(pagination_list_url))
    16 pagination_job_listing = parse_list_url.css('div.job-item')
    17 pagination_job_listing.each do |detail_jobs|
    18 pagination_url = detail_jobs.css('a')[1].attributes["href"].value
    • Thanh Hung Pham @hungpt commented Jul 20, 2021
      Master

      @phuongnhm css thẻ a với .css(a job_link)

      @phuongnhm css thẻ a với `.css(a job_link)`
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 5 of the diff

      Jul 21, 2021

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5343&start_sha=4bfb13bfe55dda4d7fd49804369162a57610bfde#b321b772986de9dfe9db0ed4138ae166e577f241_18_20)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 20, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 21, 2021
    lib/tasks/crawler.rake 0 → 100644
    32 expired_at = title_strong.css('p').text.gsub(/\s+/, " ").strip
    33 end
    34 end
    35 h3_element_value = pagination_detail_job.css('div.detail-row')
    36 h3_element_value.each do |h3_element|
    37 case h3_element.css('h3').text
    38 when "Mô tả Công việc"
    39 overview = h3_element.css('p').text.gsub(/\s+/, " ").strip
    40 when "Yêu Cầu Công Việc"
    41 requirement = h3_element.css('p').text.gsub(/\s+/, " ").strip
    42 when "Thông tin khác"
    43 other_requirement = h3_element.css('div.content_fck ul li').text.gsub(/\s+/, " ").strip
    44 end
    45 end
    46
    47 company_url = detail_jobs.css('a')[0].attributes["href"].value
    • Thanh Hung Pham @hungpt commented Jul 20, 2021
      Master

      @phuongnhm css thẻ a với .css(a company-name)

      @phuongnhm css thẻ a với `.css(a company-name)`
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 5 of the diff

      Jul 21, 2021

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5343&start_sha=4bfb13bfe55dda4d7fd49804369162a57610bfde#b321b772986de9dfe9db0ed4138ae166e577f241_47_20)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 20, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 22, 2021
    lib/tasks/crawler.rake 0 → 100644
    4 task jobs: :environment do
    5 base_url = Nokogiri::HTML(URI.open('https://careerbuilder.vn/'))
    6 list_url = base_url.css('div.menu div.dropdown-menu ul li a')[0].attributes["href"].value
    7 parse_list_url = Nokogiri::HTML(URI.open(list_url))
    8 job_listing = parse_list_url.css('div.job-item')
    9 page = 1
    10 per_page = job_listing.length
    11 total = parse_list_url.css('div.job-found p').text.split(' ')[0].gsub(',','').to_i
    12 last_page = (total.to_f / per_page.to_f).round
    13 while page <= last_page
    14 pagination_list_url = "https://careerbuilder.vn/viec-lam/tat-ca-viec-lam-trang-#{page}-vi.html"
    15 parse_list_url = Nokogiri::HTML(URI.open(pagination_list_url))
    16 pagination_job_listing = parse_list_url.css('div.job-item')
    17 pagination_job_listing.each do |detail_jobs|
    18 pagination_url = detail_jobs.css('a')[1].attributes["href"].value
    19 parse_pagination_url = Nokogiri::HTML(URI.open(pagination_url))
    • Thanh Hung Pham @hungpt commented Jul 20, 2021
      Master

      @phuongnhm rename tên biến lại cho rõ ràng

      @phuongnhm rename tên biến lại cho rõ ràng
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 5 of the diff

      Jul 21, 2021

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5343&start_sha=4bfb13bfe55dda4d7fd49804369162a57610bfde#b321b772986de9dfe9db0ed4138ae166e577f241_19_20)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 20, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 22, 2021
    lib/tasks/crawler.rake 0 → 100644
    6 list_url = base_url.css('div.menu div.dropdown-menu ul li a')[0].attributes["href"].value
    7 parse_list_url = Nokogiri::HTML(URI.open(list_url))
    8 job_listing = parse_list_url.css('div.job-item')
    9 page = 1
    10 per_page = job_listing.length
    11 total = parse_list_url.css('div.job-found p').text.split(' ')[0].gsub(',','').to_i
    12 last_page = (total.to_f / per_page.to_f).round
    13 while page <= last_page
    14 pagination_list_url = "https://careerbuilder.vn/viec-lam/tat-ca-viec-lam-trang-#{page}-vi.html"
    15 parse_list_url = Nokogiri::HTML(URI.open(pagination_list_url))
    16 pagination_job_listing = parse_list_url.css('div.job-item')
    17 pagination_job_listing.each do |detail_jobs|
    18 pagination_url = detail_jobs.css('a')[1].attributes["href"].value
    19 parse_pagination_url = Nokogiri::HTML(URI.open(pagination_url))
    20 pagination_detail_job = parse_pagination_url.css('div.container')
    21 strong_element_value = pagination_detail_job.css('div.detail-box.has-background ul li')
    • Thanh Hung Pham @hungpt commented Jul 20, 2021
      Master

      @phuongnhm rename lại tên biến cho rõ ràng

      @phuongnhm rename lại tên biến cho rõ ràng
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 5 of the diff

      Jul 21, 2021

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5343&start_sha=4bfb13bfe55dda4d7fd49804369162a57610bfde#b321b772986de9dfe9db0ed4138ae166e577f241_21_20)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 20, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 21, 2021
    lib/tasks/crawler.rake 0 → 100644
    8 job_listing = parse_list_url.css('div.job-item')
    9 page = 1
    10 per_page = job_listing.length
    11 total = parse_list_url.css('div.job-found p').text.split(' ')[0].gsub(',','').to_i
    12 last_page = (total.to_f / per_page.to_f).round
    13 while page <= last_page
    14 pagination_list_url = "https://careerbuilder.vn/viec-lam/tat-ca-viec-lam-trang-#{page}-vi.html"
    15 parse_list_url = Nokogiri::HTML(URI.open(pagination_list_url))
    16 pagination_job_listing = parse_list_url.css('div.job-item')
    17 pagination_job_listing.each do |detail_jobs|
    18 pagination_url = detail_jobs.css('a')[1].attributes["href"].value
    19 parse_pagination_url = Nokogiri::HTML(URI.open(pagination_url))
    20 pagination_detail_job = parse_pagination_url.css('div.container')
    21 strong_element_value = pagination_detail_job.css('div.detail-box.has-background ul li')
    22 title = pagination_detail_job.css('div.job-desc h1.title')[0].text
    23 strong_element_value.each do |title_strong|
    • Thanh Hung Pham @hungpt commented Jul 20, 2021
      Master

      @phuongnhm fix lại thụt hàng

      @phuongnhm fix lại thụt hàng
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 5 of the diff

      Jul 21, 2021

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5343&start_sha=4bfb13bfe55dda4d7fd49804369162a57610bfde#b321b772986de9dfe9db0ed4138ae166e577f241_23_20)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 20, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 22, 2021
    lib/tasks/crawler.rake 0 → 100644
    31 when "Hết hạn nộp"
    32 expired_at = title_strong.css('p').text.gsub(/\s+/, " ").strip
    33 end
    34 end
    35 h3_element_value = pagination_detail_job.css('div.detail-row')
    36 h3_element_value.each do |h3_element|
    37 case h3_element.css('h3').text
    38 when "Mô tả Công việc"
    39 overview = h3_element.css('p').text.gsub(/\s+/, " ").strip
    40 when "Yêu Cầu Công Việc"
    41 requirement = h3_element.css('p').text.gsub(/\s+/, " ").strip
    42 when "Thông tin khác"
    43 other_requirement = h3_element.css('div.content_fck ul li').text.gsub(/\s+/, " ").strip
    44 end
    45 end
    46
    • Thanh Hung Pham @hungpt commented Jul 20, 2021
      Master

      @phuongnhm

      • Em chưa insert Job
      • Em chưa lấy được thông tin City, Industry của Job
      Edited Jul 20, 2021 by Thanh Hung Pham
      @phuongnhm - Em chưa insert Job - Em chưa lấy được thông tin City, Industry của Job
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 5 of the diff

      Jul 21, 2021

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5343&start_sha=4bfb13bfe55dda4d7fd49804369162a57610bfde#b321b772986de9dfe9db0ed4138ae166e577f241_46_20)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 20, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 21, 2021
    lib/tasks/crawler.rake 0 → 100644
    39 overview = h3_element.css('p').text.gsub(/\s+/, " ").strip
    40 when "Yêu Cầu Công Việc"
    41 requirement = h3_element.css('p').text.gsub(/\s+/, " ").strip
    42 when "Thông tin khác"
    43 other_requirement = h3_element.css('div.content_fck ul li').text.gsub(/\s+/, " ").strip
    44 end
    45 end
    46
    47 company_url = detail_jobs.css('a')[0].attributes["href"].value
    48 parse_company_url = Nokogiri::HTML(URI.open(company_url))
    49 company = parse_company_url.css('div.container')
    50 comapny = company.css('div.company-info div.info div.content p.name').text
    51 company_info = company.css('div.company-info div.info div.content')
    52 address company_info.css('p')[1].text
    53 description = company_info.css('ul li').text
    54 overview = company.css('div.row div.content p').text.gsub(/\s+/, " ").strip
    • Thanh Hung Pham @hungpt commented Jul 20, 2021
      Master

      @phuongnhm Em chưa Insert Company

      @phuongnhm Em chưa Insert Company
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 5 of the diff

      Jul 21, 2021

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5343&start_sha=4bfb13bfe55dda4d7fd49804369162a57610bfde#b321b772986de9dfe9db0ed4138ae166e577f241_54_27)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 20, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 21, 2021
    lib/tasks/crawler.rake 0 → 100644
    50 comapny = company.css('div.company-info div.info div.content p.name').text
    51 company_info = company.css('div.company-info div.info div.content')
    52 address company_info.css('p')[1].text
    53 description = company_info.css('ul li').text
    54 overview = company.css('div.row div.content p').text.gsub(/\s+/, " ").strip
    55 end
    56 page +=1
    57 end
    58
    59 end
    60
    61 desc "TODO"
    62 task industries: :environment do
    63 industries_listing = parse_base_url.css('div.container div.list-of-working-positions div.col-md-6.col-lg-4.cus-col')
    64 industries_listing.each do |industries|
    65 industries_name = industries.css('ul.list-jobs li').text
    • Thanh Hung Pham @hungpt commented Jul 20, 2021
      Master

      @phuongnhm Vòng lặp mỗi industry

      @phuongnhm Vòng lặp mỗi industry
    • Thanh Hung Pham @hungpt commented Jul 20, 2021
      Master

      @phuongnhm Insert industry vào DB

      @phuongnhm Insert industry vào DB
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 5 of the diff

      Jul 21, 2021

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5343&start_sha=4bfb13bfe55dda4d7fd49804369162a57610bfde#b321b772986de9dfe9db0ed4138ae166e577f241_65_110)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 20, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 21, 2021
    lib/tasks/crawler.rake 0 → 100644
    83 cities_foreign.each do |city|
    84 city_name = city.text
    85 City.find_or_create_by(
    86 name: city_name
    87 )
    88 Region.find_or_create_by(name: 'Nước Ngoài').id
    89 puts 'Added: ' + (city_name ? city_name : '')
    90 end
    91 end
    92
    93
    94 desc "TODO"
    95 task regions: :environment do
    96 regions = parse_base_url.css('div.container div.col-xl-3 div.main-jobs-by-location h3')
    97 regions.each do |region|
    98 region_name region.text.gsub('Việc Làm','')
    • Thanh Hung Pham @hungpt commented Jul 20, 2021
      Master

      @phuongnhm Chỗ này bị thiếu dấu =

      @phuongnhm Chỗ này bị thiếu dấu `=`
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 5 of the diff

      Jul 21, 2021

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5343&start_sha=4bfb13bfe55dda4d7fd49804369162a57610bfde#b321b772986de9dfe9db0ed4138ae166e577f241_98_145)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 20, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 21, 2021
    lib/tasks/crawler.rake 0 → 100644
    62 task industries: :environment do
    63 industries_listing = parse_base_url.css('div.container div.list-of-working-positions div.col-md-6.col-lg-4.cus-col')
    64 industries_listing.each do |industries|
    65 industries_name = industries.css('ul.list-jobs li').text
    66 puts 'Added: ' + (industries_name ? industries_name : '')
    67 end
    68
    69 end
    70
    71 desc "TODO"
    72 task cities: :environment do
    73 cities = parse_base_url.css('div.container div.col-xl-3 div.main-jobs-by-location div.jobs-in-country li a')
    74 cities.each do |city|
    75 city_name = city.text.gsub('Việc làm tại','')
    76 City.find_or_create_by(
    77 name: city_name
    • Thanh Hung Pham @hungpt commented Jul 20, 2021
      Master

      @phuongnhm Em add region_id ở đây

      @phuongnhm Em add `region_id` ở đây
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 5 of the diff

      Jul 21, 2021

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5343&start_sha=4bfb13bfe55dda4d7fd49804369162a57610bfde#b321b772986de9dfe9db0ed4138ae166e577f241_77_127)
      Toggle commit list
    Please register or sign in to reply
  • Nguyen Hoang Mai Phuong @phuongnhm

    added 1 commit

    • a7211338 - import data into Job

    Compare with previous version

    Jul 21, 2021

    added 1 commit

    • a7211338 - import data into Job

    Compare with previous version

    added 1 commit * a7211338 - import data into Job [Compare with previous version](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5343&start_sha=4bfb13bfe55dda4d7fd49804369162a57610bfde)
    Toggle commit list
  • Nguyen Hoang Mai Phuong @phuongnhm

    added 1 commit

    • 8b4266e4 - fix import data

    Compare with previous version

    Jul 21, 2021

    added 1 commit

    • 8b4266e4 - fix import data

    Compare with previous version

    added 1 commit * 8b4266e4 - fix import data [Compare with previous version](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5344&start_sha=a72113383152567ec5f5e598c7b411613f92ab16)
    Toggle commit list
  • Nguyen Hoang Mai Phuong @phuongnhm

    added 1 commit

    • 9794ac57 - fix bug

    Compare with previous version

    Jul 22, 2021

    added 1 commit

    • 9794ac57 - fix bug

    Compare with previous version

    added 1 commit * 9794ac57 - fix bug [Compare with previous version](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5346&start_sha=8b4266e424eace9da47866ff72e30815ccef5011)
    Toggle commit list
  • Nguyen Hoang Mai Phuong @phuongnhm

    added 1 commit

    • fde8ff8e - fix bug

    Compare with previous version

    Jul 22, 2021

    added 1 commit

    • fde8ff8e - fix bug

    Compare with previous version

    added 1 commit * fde8ff8e - fix bug [Compare with previous version](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5347&start_sha=9794ac57c8809197200fd1889a300f0a39bec46e)
    Toggle commit list
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 22, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 22, 2021
    db/migrate/20210720145646_change_jobs.rb 0 → 100644
    1 class ChangeJobs < ActiveRecord::Migration[6.1]
    2 def up
    3 change_column :jobs, :salary, :string
    4 remove_column :jobs, :industries_type, :text
    • Thanh Hung Pham @hungpt commented Jul 22, 2021
      Master

      @phuongnhm Chưa xóa 2 dòng này hả em? Trước đó bảng jobs không có 2 columns này nha. Tương tự bên down

      remove_column :jobs, :industries_type, :text
      remove_column :jobs, :location, :text
      @phuongnhm Chưa xóa 2 dòng này hả em? Trước đó bảng `jobs` không có 2 columns này nha. Tương tự bên `down` ``` remove_column :jobs, :industries_type, :text remove_column :jobs, :location, :text ```
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 9 of the diff

      Jul 23, 2021

      changed this line in version 9 of the diff

      changed this line in [version 9 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5351&start_sha=fde8ff8e2f30f3ed80c6328e245becbd4d4d0c4b#efe8639b87504e7cb18614ad97b5716ca5404d90_4_4)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on the diff Jul 22, 2021
    Resolved by Thanh Hung Pham Jul 23, 2021
    lib/tasks/crawler.rake 0 → 100644
    1 require 'open-uri'
    2
    3 namespace :crawler do
    4 desc 'Crawl Jobs and Companies'
    • Thanh Hung Pham @hungpt commented Jul 22, 2021
      Master

      @phuongnhm

      • Em thêm 1 task all. Để chạy 1 lần để import tất cả các bảng nha.
      • Rồi em sử dụng gem này set crontab cho nó chạy mỗi ngày 1 lần https://github.com/javan/whenever
      • Em log lại quá trình import ra file nha. Tham khảo link dưới đây https://guides.rubyonrails.org/debugging_rails_applications.html

      • Nội dung log (cho task jobs thôi)

        - Thời gian start
        - Link company crawl được (mấy link next không cần log lại nha em)
        - Link job crawl được (mấy link next không cần log lại nha em)
        - Thời gian end
      Edited Jul 23, 2021 by Thanh Hung Pham
      @phuongnhm - Em thêm 1 task all. Để chạy 1 lần để import tất cả các bảng nha. - Rồi em sử dụng gem này set crontab cho nó chạy mỗi ngày 1 lần https://github.com/javan/whenever - Em log lại quá trình import ra file nha. Tham khảo link dưới đây https://guides.rubyonrails.org/debugging_rails_applications.html - Nội dung log (cho task jobs thôi) ``` - Thời gian start - Link company crawl được (mấy link next không cần log lại nha em) - Link job crawl được (mấy link next không cần log lại nha em) - Thời gian end ```
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on the diff Jul 22, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 22, 2021
    lib/tasks/crawler.rake 0 → 100644
    6 base_url = Nokogiri::HTML(URI.open('https://careerbuilder.vn/'))
    7 job_page = base_url.css('div.menu div.dropdown-menu ul li a')[0].attributes['href'].value
    8 parse_job_page = Nokogiri::HTML(URI.open(job_page))
    9 job_listing = parse_job_page.css('div.job-item')
    10 per_page = job_listing.present? ? job_listing.length : 0
    11 page = 1
    12 total = parse_job_page.css('div.job-found p').text.split(' ')[0].gsub(',', '').to_i
    13 last_page = (total.to_f / per_page).round
    14
    15 while page <= last_page
    16 pagination_page_job = "https://careerbuilder.vn/viec-lam/tat-ca-viec-lam-trang-#{page}-vi.html"
    17 parse_pagination_page_job = Nokogiri::HTML(URI.open(pagination_page_job))
    18 pagination_job_listing = parse_pagination_page_job.css('div.job-item')
    19 pagination_job_listing.each do |detail_jobs|
    20 company_url = detail_jobs.css('a.company-name').attribute('href').text
    21 next if company_url == 'javascript:void(0);'
    • Thanh Hung Pham @hungpt commented Jul 22, 2021
      Master

      @phuongnhm Fix rubocop check chỗ này nha em.

      @phuongnhm Fix rubocop check chỗ này nha em.
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 22, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 22, 2021
    lib/tasks/crawler.rake 0 → 100644
    9 job_listing = parse_job_page.css('div.job-item')
    10 per_page = job_listing.present? ? job_listing.length : 0
    11 page = 1
    12 total = parse_job_page.css('div.job-found p').text.split(' ')[0].gsub(',', '').to_i
    13 last_page = (total.to_f / per_page).round
    14
    15 while page <= last_page
    16 pagination_page_job = "https://careerbuilder.vn/viec-lam/tat-ca-viec-lam-trang-#{page}-vi.html"
    17 parse_pagination_page_job = Nokogiri::HTML(URI.open(pagination_page_job))
    18 pagination_job_listing = parse_pagination_page_job.css('div.job-item')
    19 pagination_job_listing.each do |detail_jobs|
    20 company_url = detail_jobs.css('a.company-name').attribute('href').text
    21 next if company_url == 'javascript:void(0);'
    22 slug_company = CGI.escape(company_url.gsub('https://careerbuilder.vn/vi/nha-tuyen-dung/', '').strip)
    23 company_page = "https://careerbuilder.vn/vi/nha-tuyen-dung/#{slug_company}"
    24 puts company_page
    • Thanh Hung Pham @hungpt commented Jul 22, 2021
      Master

      @phuongnhm Dòng này để mình debug ở local thôi em. Xóa đi nha.

      @phuongnhm Dòng này để mình debug ở local thôi em. Xóa đi nha.
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 9 of the diff

      Jul 23, 2021

      changed this line in version 9 of the diff

      changed this line in [version 9 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5351&start_sha=fde8ff8e2f30f3ed80c6328e245becbd4d4d0c4b#b321b772986de9dfe9db0ed4138ae166e577f241_24_26)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on the diff Jul 22, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 22, 2021
    lib/tasks/crawler.rake 0 → 100644
    13 last_page = (total.to_f / per_page).round
    14
    15 while page <= last_page
    16 pagination_page_job = "https://careerbuilder.vn/viec-lam/tat-ca-viec-lam-trang-#{page}-vi.html"
    17 parse_pagination_page_job = Nokogiri::HTML(URI.open(pagination_page_job))
    18 pagination_job_listing = parse_pagination_page_job.css('div.job-item')
    19 pagination_job_listing.each do |detail_jobs|
    20 company_url = detail_jobs.css('a.company-name').attribute('href').text
    21 next if company_url == 'javascript:void(0);'
    22 slug_company = CGI.escape(company_url.gsub('https://careerbuilder.vn/vi/nha-tuyen-dung/', '').strip)
    23 company_page = "https://careerbuilder.vn/vi/nha-tuyen-dung/#{slug_company}"
    24 puts company_page
    25 parse_company_page = Nokogiri::HTML(URI.open(company_page))
    26 company = parse_company_page.css('div.container')
    27 company_name = company.css('div.company-info div.content p.name')
    28 next if company_name.nil?
    • Thanh Hung Pham @hungpt commented Jul 22, 2021
      Master

      @phuongnhm Fix rubocop check chỗ này nha em.

      @phuongnhm Fix rubocop check chỗ này nha em.
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 22, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 22, 2021
    lib/tasks/crawler.rake 0 → 100644
    14
    15 while page <= last_page
    16 pagination_page_job = "https://careerbuilder.vn/viec-lam/tat-ca-viec-lam-trang-#{page}-vi.html"
    17 parse_pagination_page_job = Nokogiri::HTML(URI.open(pagination_page_job))
    18 pagination_job_listing = parse_pagination_page_job.css('div.job-item')
    19 pagination_job_listing.each do |detail_jobs|
    20 company_url = detail_jobs.css('a.company-name').attribute('href').text
    21 next if company_url == 'javascript:void(0);'
    22 slug_company = CGI.escape(company_url.gsub('https://careerbuilder.vn/vi/nha-tuyen-dung/', '').strip)
    23 company_page = "https://careerbuilder.vn/vi/nha-tuyen-dung/#{slug_company}"
    24 puts company_page
    25 parse_company_page = Nokogiri::HTML(URI.open(company_page))
    26 company = parse_company_page.css('div.container')
    27 company_name = company.css('div.company-info div.content p.name')
    28 next if company_name.nil?
    29 name = company.css('div.company-info div.content p.name').text
    • Thanh Hung Pham @hungpt commented Jul 22, 2021
      Master

      @phuongnhm Cái này company.css('div.company-info div.content p.name') em đã gán vào biến company_name ở trên rồi. Sao không dùng lại em?

      Do mình đã kiểm tra company_name nil rồi. Nên sử dụng trực tiếp lúc insert luôn. Không cần tạo biến name

      @phuongnhm Cái này `company.css('div.company-info div.content p.name')` em đã gán vào biến `company_name` ở trên rồi. Sao không dùng lại em? Do mình đã kiểm tra `company_name` nil rồi. Nên sử dụng trực tiếp lúc insert luôn. Không cần tạo biến `name`
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 9 of the diff

      Jul 23, 2021

      changed this line in version 9 of the diff

      changed this line in [version 9 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5351&start_sha=fde8ff8e2f30f3ed80c6328e245becbd4d4d0c4b#b321b772986de9dfe9db0ed4138ae166e577f241_29_30)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 22, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 22, 2021
    lib/tasks/crawler.rake 0 → 100644
    20 company_url = detail_jobs.css('a.company-name').attribute('href').text
    21 next if company_url == 'javascript:void(0);'
    22 slug_company = CGI.escape(company_url.gsub('https://careerbuilder.vn/vi/nha-tuyen-dung/', '').strip)
    23 company_page = "https://careerbuilder.vn/vi/nha-tuyen-dung/#{slug_company}"
    24 puts company_page
    25 parse_company_page = Nokogiri::HTML(URI.open(company_page))
    26 company = parse_company_page.css('div.container')
    27 company_name = company.css('div.company-info div.content p.name')
    28 next if company_name.nil?
    29 name = company.css('div.company-info div.content p.name').text
    30 company_info = company.css('div.company-info div.content')
    31 address = company_info.css('p')[1].try(:text)
    32 description = company_info.css('ul li').text
    33 overview = company.css('div.row div.content p').text.squish.strip
    34 Company.find_or_create_by(
    35 name: name,
    • Thanh Hung Pham @hungpt commented Jul 22, 2021
      Master

      @phuongnhm Bỏ biến name dùng luôn company_name.text ở đây luôn.

      @phuongnhm Bỏ biến `name` dùng luôn `company_name.text` ở đây luôn.
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 9 of the diff

      Jul 23, 2021

      changed this line in version 9 of the diff

      changed this line in [version 9 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5351&start_sha=fde8ff8e2f30f3ed80c6328e245becbd4d4d0c4b#b321b772986de9dfe9db0ed4138ae166e577f241_35_39)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 22, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 22, 2021
    lib/tasks/crawler.rake 0 → 100644
    29 name = company.css('div.company-info div.content p.name').text
    30 company_info = company.css('div.company-info div.content')
    31 address = company_info.css('p')[1].try(:text)
    32 description = company_info.css('ul li').text
    33 overview = company.css('div.row div.content p').text.squish.strip
    34 Company.find_or_create_by(
    35 name: name,
    36 address: address,
    37 description: description,
    38 overview: overview
    39 )
    40
    41 slug_job = CGI.escape(detail_jobs.css('a.job_link').attribute('href').text
    42 .gsub('https://careerbuilder.vn/vi/tim-viec-lam/', '').strip)
    43 job_detail_page = "https://careerbuilder.vn/vi/tim-viec-lam/#{slug_job}"
    44 puts job_detail_page
    • Thanh Hung Pham @hungpt commented Jul 22, 2021
      Master

      @phuongnhm Tương tự, xóa dòng này nha em.

      @phuongnhm Tương tự, xóa dòng này nha em.
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 9 of the diff

      Jul 23, 2021

      changed this line in version 9 of the diff

      changed this line in [version 9 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5351&start_sha=fde8ff8e2f30f3ed80c6328e245becbd4d4d0c4b#b321b772986de9dfe9db0ed4138ae166e577f241_44_48)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on the diff Jul 22, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 22, 2021
    lib/tasks/crawler.rake 0 → 100644
    33 overview = company.css('div.row div.content p').text.squish.strip
    34 Company.find_or_create_by(
    35 name: name,
    36 address: address,
    37 description: description,
    38 overview: overview
    39 )
    40
    41 slug_job = CGI.escape(detail_jobs.css('a.job_link').attribute('href').text
    42 .gsub('https://careerbuilder.vn/vi/tim-viec-lam/', '').strip)
    43 job_detail_page = "https://careerbuilder.vn/vi/tim-viec-lam/#{slug_job}"
    44 puts job_detail_page
    45 parse_job_detail_page = Nokogiri::HTML(URI.open(job_detail_page))
    46 detail_job = parse_job_detail_page.css('div.container')
    47 title = detail_job.css('div.job-desc h1.title')
    48 next if title.nil?
    • Thanh Hung Pham @hungpt commented Jul 22, 2021
      Master

      @phuongnhm Fix rubocop check chỗ này nha em.

      @phuongnhm Fix rubocop check chỗ này nha em.
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 22, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 22, 2021
    lib/tasks/crawler.rake 0 → 100644
    34 Company.find_or_create_by(
    35 name: name,
    36 address: address,
    37 description: description,
    38 overview: overview
    39 )
    40
    41 slug_job = CGI.escape(detail_jobs.css('a.job_link').attribute('href').text
    42 .gsub('https://careerbuilder.vn/vi/tim-viec-lam/', '').strip)
    43 job_detail_page = "https://careerbuilder.vn/vi/tim-viec-lam/#{slug_job}"
    44 puts job_detail_page
    45 parse_job_detail_page = Nokogiri::HTML(URI.open(job_detail_page))
    46 detail_job = parse_job_detail_page.css('div.container')
    47 title = detail_job.css('div.job-desc h1.title')
    48 next if title.nil?
    49 title_job = detail_job.css('div.job-desc h1.title').text
    • Thanh Hung Pham @hungpt commented Jul 22, 2021
      Master

      @phuongnhm Tương tự, xóa biến này luôn nha em. dùng trực tiếp biến title ở trên lúc insert vào DB á.

      @phuongnhm Tương tự, xóa biến này luôn nha em. dùng trực tiếp biến `title` ở trên lúc insert vào DB á.
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 9 of the diff

      Jul 23, 2021

      changed this line in version 9 of the diff

      changed this line in [version 9 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5351&start_sha=fde8ff8e2f30f3ed80c6328e245becbd4d4d0c4b#b321b772986de9dfe9db0ed4138ae166e577f241_49_52)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 22, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 22, 2021
    lib/tasks/crawler.rake 0 → 100644
    67 detail_require = detail_job.css('div.detail-row')
    68 detail_require.each do |detail|
    69 case detail.css('h3').text
    70 when 'Phúc lợi '
    71 benefits = detail.css('ul li').text
    72 when 'Mô tả Công việc'
    73 overview = detail.css('p').text
    74 when 'Yêu Cầu Công Việc'
    75 requirement = detail.css('p').text
    76 when 'Thông tin khác'
    77 other_requirement = detail.css('div.content_fck ul li').text.squish
    78 end
    79 end
    80
    81 job = Job.find_or_create_by(
    82 title: title_job,
    • Thanh Hung Pham @hungpt commented Jul 22, 2021
      Master

      @phuongnhm Dùng luôn biến title.text ở đây luôn em.

      @phuongnhm Dùng luôn biến `title.text` ở đây luôn em.
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 9 of the diff

      Jul 23, 2021

      changed this line in version 9 of the diff

      changed this line in [version 9 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5351&start_sha=fde8ff8e2f30f3ed80c6328e245becbd4d4d0c4b#b321b772986de9dfe9db0ed4138ae166e577f241_82_87)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 22, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 22, 2021
    lib/tasks/crawler.rake 0 → 100644
    77 other_requirement = detail.css('div.content_fck ul li').text.squish
    78 end
    79 end
    80
    81 job = Job.find_or_create_by(
    82 title: title_job,
    83 salary: salary,
    84 experience: experience,
    85 type: type,
    86 level: level,
    87 expired_at: expired_at,
    88 benefits: benefits,
    89 overview: overview,
    90 requirement: requirement,
    91 other_requirement: other_requirement,
    92 company_id: Company.find_by(name: name).id
    • Thanh Hung Pham @hungpt commented Jul 22, 2021
      Master

      @phuongnhm Sửa lại dùng biến company_name.text luôn nha em.

      @phuongnhm Sửa lại dùng biến `company_name.text` luôn nha em.
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 9 of the diff

      Jul 23, 2021

      changed this line in version 9 of the diff

      changed this line in [version 9 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5351&start_sha=fde8ff8e2f30f3ed80c6328e245becbd4d4d0c4b#b321b772986de9dfe9db0ed4138ae166e577f241_92_97)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 22, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 22, 2021
    lib/tasks/crawler.rake 0 → 100644
    82 title: title_job,
    83 salary: salary,
    84 experience: experience,
    85 type: type,
    86 level: level,
    87 expired_at: expired_at,
    88 benefits: benefits,
    89 overview: overview,
    90 requirement: requirement,
    91 other_requirement: other_requirement,
    92 company_id: Company.find_by(name: name).id
    93 )
    94
    95 industries = detail_job.css('div.detail-box.has-background ul li p a')
    96 industries.each do |industry|
    97 industry_name = industry.text.squish
    • Thanh Hung Pham @hungpt commented Jul 22, 2021
      Master

      @phuongnhm Line 97-101 thụt hàng bị sai nè em.

      @phuongnhm Line 97-101 thụt hàng bị sai nè em.
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 9 of the diff

      Jul 23, 2021

      changed this line in version 9 of the diff

      changed this line in [version 9 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5351&start_sha=fde8ff8e2f30f3ed80c6328e245becbd4d4d0c4b#b321b772986de9dfe9db0ed4138ae166e577f241_97_102)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jul 22, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 23, 2021
    lib/tasks/crawler.rake 0 → 100644
    83 salary: salary,
    84 experience: experience,
    85 type: type,
    86 level: level,
    87 expired_at: expired_at,
    88 benefits: benefits,
    89 overview: overview,
    90 requirement: requirement,
    91 other_requirement: other_requirement,
    92 company_id: Company.find_by(name: name).id
    93 )
    94
    95 industries = detail_job.css('div.detail-box.has-background ul li p a')
    96 industries.each do |industry|
    97 industry_name = industry.text.squish
    98 industries = Industry.find_or_create_by(
    • Thanh Hung Pham @hungpt commented Jul 22, 2021
      Master

      @phuongnhm Tên biến bị sai nè em. Chỗ này Industry.find_or_create_by trả về 1 Industry thôi. Sao để số nhiều? Refactor lại từ dòng 96-102.

      job_industries = []
      industries.each do |industry|
        industry_name = industry.text.squish
        job_industries << Industry.find_or_create_by(name: industry_name)
      end
      job.industries << job_industries
      Edited Jul 23, 2021
      @phuongnhm Tên biến bị sai nè em. Chỗ này `Industry.find_or_create_by` trả về 1 Industry thôi. Sao để số nhiều? Refactor lại từ dòng 96-102. ``` job_industries = [] industries.each do |industry| industry_name = industry.text.squish job_industries << Industry.find_or_create_by(name: industry_name) end job.industries << job_industries ```
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 9 of the diff

      Jul 23, 2021

      changed this line in version 9 of the diff

      changed this line in [version 9 of the diff](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5351&start_sha=fde8ff8e2f30f3ed80c6328e245becbd4d4d0c4b#b321b772986de9dfe9db0ed4138ae166e577f241_98_102)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on the diff Jul 22, 2021
    Resolved by Nguyen Hoang Mai Phuong Jul 23, 2021
    lib/tasks/crawler.rake 0 → 100644
    90 requirement: requirement,
    91 other_requirement: other_requirement,
    92 company_id: Company.find_by(name: name).id
    93 )
    94
    95 industries = detail_job.css('div.detail-box.has-background ul li p a')
    96 industries.each do |industry|
    97 industry_name = industry.text.squish
    98 industries = Industry.find_or_create_by(
    99 name: industry_name
    100 )
    101 job.industries << industries
    102 end
    103
    104 location = detail_job.css('div.map p a')
    105 location.each do |city|
    • Thanh Hung Pham @hungpt commented Jul 22, 2021
      Master

      @phuongnhm Refactor lại tương tự như industry ở trên

      @phuongnhm Refactor lại tương tự như industry ở trên
    Please register or sign in to reply
  • Nguyen Hoang Mai Phuong @phuongnhm

    added 1 commit

    • fe91b8cf - fix bug crawling

    Compare with previous version

    Jul 23, 2021

    added 1 commit

    • fe91b8cf - fix bug crawling

    Compare with previous version

    added 1 commit * fe91b8cf - fix bug crawling [Compare with previous version](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5351&start_sha=fde8ff8e2f30f3ed80c6328e245becbd4d4d0c4b)
    Toggle commit list
  • Nguyen Hoang Mai Phuong @phuongnhm

    added 2 commits

    • 6ba9bc64 - fix crawler
    • 2a939b3b - fix crawler

    Compare with previous version

    Jul 23, 2021

    added 2 commits

    • 6ba9bc64 - fix crawler
    • 2a939b3b - fix crawler

    Compare with previous version

    added 2 commits * 6ba9bc64 - fix crawler * 2a939b3b - fix crawler [Compare with previous version](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5352&start_sha=fe91b8cfefa0e26786b14baa643555315b2ecdcb)
    Toggle commit list
  • Nguyen Hoang Mai Phuong @phuongnhm

    added 1 commit

    • 99daf536 - fix crawler

    Compare with previous version

    Jul 23, 2021

    added 1 commit

    • 99daf536 - fix crawler

    Compare with previous version

    added 1 commit * 99daf536 - fix crawler [Compare with previous version](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5353&start_sha=2a939b3b15c2ff4a20a1afe2c163158f95afd67a)
    Toggle commit list
  • Nguyen Hoang Mai Phuong @phuongnhm

    added 1 commit

    • e080cf4f - fix crawler

    Compare with previous version

    Jul 23, 2021

    added 1 commit

    • e080cf4f - fix crawler

    Compare with previous version

    added 1 commit * e080cf4f - fix crawler [Compare with previous version](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5354&start_sha=99daf5363754f36799da1c9b2b4a11bf9dab1dd4)
    Toggle commit list
  • Nguyen Hoang Mai Phuong @phuongnhm

    added 1 commit

    • 49fd4b09 - fix crawler

    Compare with previous version

    Jul 23, 2021

    added 1 commit

    • 49fd4b09 - fix crawler

    Compare with previous version

    added 1 commit * 49fd4b09 - fix crawler [Compare with previous version](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5355&start_sha=e080cf4f1a1f77a1d520d1b63e96620c648b73e3)
    Toggle commit list
  • Nguyen Hoang Mai Phuong @phuongnhm

    resolved all discussions

    Jul 23, 2021

    resolved all discussions

    resolved all discussions
    Toggle commit list
  • Nguyen Hoang Mai Phuong @phuongnhm

    added 1 commit

    • 2f3cbcc4 - fix crawler

    Compare with previous version

    Jul 23, 2021

    added 1 commit

    • 2f3cbcc4 - fix crawler

    Compare with previous version

    added 1 commit * 2f3cbcc4 - fix crawler [Compare with previous version](https://gitlab.zigexn.vn/phuongnhm/VeNJOB/merge_requests/2/diffs?diff_id=5356&start_sha=49fd4b09fc5c20d5e24a847f3066ca94ec00464e)
    Toggle commit list
  • Thanh Hung Pham @hungpt

    mentioned in commit 56fee0d7

    Jul 23, 2021

    mentioned in commit 56fee0d7

    mentioned in commit 56fee0d7b17d6cd2225b94e11f91d9691bb541ce
    Toggle commit list
  • Thanh Hung Pham @hungpt

    merged

    Jul 23, 2021

    merged

    merged
    Toggle commit list
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment
Assignee
No assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
2
2 participants
Reference: phuongnhm/VeNJOB!2
×

Revert this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.
×

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.