fix crawler

parent 6ba9bc64
Pipeline #1359 canceled with stages
in 0 seconds
......@@ -103,8 +103,10 @@ namespace :crawler do
industries = detail_job.css('div.detail-box.has-background ul li p a')
industries.each do |industry|
name = industry.text.squish
job_industries << Industry.find__by(name: name)
job_industries << Industry.find_by(name: name)
end
next if job_industries_cities.nil?
job.industries << job_industries
job_cities = []
......@@ -113,7 +115,9 @@ namespace :crawler do
name = city.text
job_cities << City.find_by(name: name)
end
job.cities << job_cities unless job_cities.nil?
next if job_cities.nil?
job.cities << job_cities
end
page += 1
end
......
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 to comment