simplonco / carto-emploi

Projet de cartographie des emplois du numérique en France
0 stars 3 forks source link

Parser stops when offer is no available #18

Closed annemarie35 closed 9 years ago

annemarie35 commented 9 years ago

When i start the insert_db parser, if an offer is not available, the parser only receive nil response. The body_parser.rb can For example

    if   employement_type != nil || employement_type != ""
      employement_type = employement_type[/[^-]+/]
      employement_type.gsub!(/'/, "''")
      employement_type.strip
    else
      employement_type =  "Information non disponible"
    end

but when i run insert_db.rb , i see this error

/home/anne-marie/Documents/4_WORK_FREELANCE/SimplonProd/jobseeker/parser/body_parser.rb:64:in `search_employment_type': undefined method `gsub!' for nil:NilClass (NoMethodError)
annemarie35 commented 9 years ago

Fait, commit https://github.com/simplonco/carto-emploi/commit/3888cb6d60001b3ee76a2bd143e356538584e85f