AyOK-Code / oscn_scraper

MIT License
1 stars 1 forks source link

Incorrect Count Code being sent back in some cases #8

Closed holdenmitchell closed 2 years ago

holdenmitchell commented 2 years ago

Description

There are times when additional information is included in the Count as Disposed: text description with parenthesis:

image

In this case, the method is not properly extracting the code from the end of the description (DU2II). Instead it is sending back the first one ( COCAINE ). The problem can be traced back to this method in the parsers/counts.rb file:

# parsers/counts.rb
def disposition_code(party_html)
    data = party_html.css('td')[2]&.children
    full = data[3]&.text&.gsub('Count as Disposed:', '')&.squish
    full.split('(')[1]&.gsub(')', '') if full.present?
end
holdenmitchell commented 2 years ago

Example Case on OSCN