Commit d8e11b39 by thanhnd

shorten CSS selector

parent 6f382fd2
Pipeline #460 canceled with stages
in 0 seconds
...@@ -16,11 +16,12 @@ namespace :crawler do ...@@ -16,11 +16,12 @@ namespace :crawler do
#get link for next page #get link for next page
np = Nokogiri::HTML(open(list_url)) np = Nokogiri::HTML(open(list_url))
nextpage = np.css('html body.jobseeker_site.A-Bootstrap div#uni_wrapper div#uni_container div.cb-container div.col-sm-12.col-md-9.col-ListJobCate div.paginationTwoStatus a.right') #nextpage = np.css('html body.jobseeker_site.A-Bootstrap div#uni_wrapper div#uni_container div.cb-container div.col-sm-12.col-md-9.col-ListJobCate div.paginationTwoStatus a.right')
nextpage = np.css('div.paginationTwoStatus a.right')
puts nextpage[0]["href"] puts nextpage[0]["href"]
#get all links in one page #get all links in one page
links = page.css('html body.jobseeker_site.A-Bootstrap div#uni_wrapper div#uni_container div.cb-container div.col-sm-12.col-md-9.col-ListJobCate div.gird_standard dl dd.brief span.jobtitle h3.job a') links = page.css('span.jobtitle h3.job a')
area = Area.find(1) area = Area.find(1)
links.each do |link| links.each do |link|
......
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