Skip to content

Commit

Permalink
now can detect over 200 record
Browse files Browse the repository at this point in the history
  • Loading branch information
billy3321 committed Jan 3, 2016
1 parent 11e97d2 commit 2482334
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion get_judgements.rb
Expand Up @@ -303,7 +303,10 @@ def main
success = false
until success
content = get_page(url, url, proxy)
matches = scan_content(content, /共\s*([0-9]*)\s*筆\s*\/\s*每頁\s*20\s*筆\s*\//)
matches = scan_content(content, /本次查詢結果共\s*([0-9]*)\s*筆/)
if matches.length == 0
matches = scan_content(content, /共\s*([0-9]*)\s*筆\s*\/\s*每頁\s*20\s*筆\s*\//)
end
if matches.length == 0
puts "page seems something wrong"
write_file('./log/error1.html', content)
Expand All @@ -315,6 +318,8 @@ def main
if matches[0][0].to_i == 0
puts "#{court['name']} #{division['name']} has no record"
next
else
puts "#{court['name']} #{division['name']} found #{matches[0][0]} records"
end
count = matches[0][0].to_i
matches = scan_content(content, /FJUDQRY03_1\.aspx\?id=[0-9]*&([^"]*)/)
Expand Down

0 comments on commit 2482334

Please sign in to comment.