Guest User

Untitled

a guest
Dec 13th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.20 KB | None | 0 0
  1. <html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  2. <title>Recorded Crime Offences (Number) by Garda Station, Type of Offence and<BR>
  3. Year</title>
  4. </head>
  5. <body>
  6. <table border="">
  7. <tbody><tr align="LEFT">
  8. <th colspan="8">Recorded Crime Offences (Number) by Garda Station, Type of Offence and<br>
  9. Year</th>
  10. </tr>
  11. <tr align="LEFT">
  12. <th colspan="2"> </th>
  13. <th valign="TOP" colspan="1">2011</th>
  14. <th valign="TOP" colspan="1">2012</th>
  15. <th valign="TOP" colspan="1">2013</th>
  16. <th valign="TOP" colspan="1">2014</th>
  17. <th valign="TOP" colspan="1">2015</th>
  18. <th valign="TOP" colspan="1">2016</th>
  19. </tr>
  20. <tr align="RIGHT">
  21. <th align="LEFT" valign="TOP" rowspan="12">Balbriggan, D.M.R. Northern Division</th>
  22. <th align="LEFT">03 ,Attempts/threats to murder, assaults, harassments and related offences</th>
  23. <td>96</td>
  24. <td>89</td>
  25. <td>70</td>
  26. <td>97</td>
  27. <td>103</td>
  28. <td>103</td>
  29. </tr>
  30. <tr align="RIGHT">
  31. <th align="LEFT">04 ,Dangerous or negligent acts</th>
  32. <td>72</td>
  33. <td>67</td>
  34. <td>50</td>
  35. <td>53</td>
  36. <td>45</td>
  37. <td>43</td>
  38. </tr>
  39. <tr align="RIGHT">
  40. <th align="LEFT">05 ,Kidnapping and related offences</th>
  41. <td>0</td>
  42. <td>0</td>
  43. <td>1</td>
  44. <td>3</td>
  45. <td>0</td>
  46. <td>7</td>
  47. </tr>
  48. <tr align="RIGHT">
  49. <th align="LEFT">06 ,Robbery, extortion and hijacking offences</th>
  50. <td>16</td>
  51. <td>19</td>
  52. <td>16</td>
  53. <td>7</td>
  54. <td>11</td>
  55. <td>13</td>
  56. </tr>
  57. <tr align="RIGHT">
  58. <th align="LEFT">07 ,Burglary and related offences</th>
  59. <td>177</td>
  60. <td>190</td>
  61. <td>157</td>
  62. <td>140</td>
  63. <td>151</td>
  64. <td>139</td>
  65. </tr>
  66. <tr align="RIGHT">
  67. <th align="LEFT">08 ,Theft and related offences</th>
  68. <td>510</td>
  69. <td>466</td>
  70. <td>495</td>
  71. <td>542</td>
  72. <td>445</td>
  73. <td>302</td>
  74. </tr>
  75. <tr align="RIGHT">
  76. <th align="LEFT">09 ,Fraud, deception and related offences</th>
  77. <td>66</td>
  78. <td>76</td>
  79. <td>126</td>
  80. <td>114</td>
  81. <td>98</td>
  82. <td>66</td>
  83. </tr>
  84. <tr align="RIGHT">
  85. <th align="LEFT">10 ,Controlled drug offences</th>
  86. <td>113</td>
  87. <td>100</td>
  88. <td>64</td>
  89. <td>55</td>
  90. <td>44</td>
  91. <td>80</td>
  92. </tr>
  93. <tr align="RIGHT">
  94. <th align="LEFT">11 ,Weapons and Explosives Offences</th>
  95. <td>22</td>
  96. <td>18</td>
  97. <td>13</td>
  98. <td>10</td>
  99. <td>19</td>
  100. <td>17</td>
  101. </tr>
  102. <tr align="RIGHT">
  103. <th align="LEFT">12 ,Damage to property and to the environment</th>
  104. <td>257</td>
  105. <td>266</td>
  106. <td>269</td>
  107. <td>203</td>
  108. <td>213</td>
  109. <td>177</td>
  110. </tr>
  111. <tr align="RIGHT">
  112. <th align="LEFT">13 ,Public order and other social code offences</th>
  113. <td>168</td>
  114. <td>115</td>
  115. <td>93</td>
  116. <td>78</td>
  117. <td>79</td>
  118. <td>92</td>
  119. </tr>
  120. <tr align="RIGHT">
  121. <th align="LEFT">15 ,Offences against government, justice procedures and organisation of crime</th>
  122. <td>45</td>
  123. <td>48</td>
  124. <td>39</td>
  125. <td>39</td>
  126. <td>66</td>
  127. <td>50</td>
  128. </tr>
  129. <tr align="LEFT">
  130. <td colspan="8"><a href="http://www.cso.ie/en/methods/crime/recordedcrime/">See Background Notes</a>
  131. </td>
  132. </tr>
  133. </tbody></table>
  134.  
  135. </body></html>
  136.  
  137. Figure 0 : 96
  138. Figure 1 : 89
  139. Figure 2 : 70
  140. Figure 3 : 97
  141. Figure 4 : 103
  142. Figure 5 : 103
  143. Figure 6 : 72
  144. Figure 7 : 67
  145. Figure 8 : 50
  146. Figure 9 : 53
  147. Figure 10 : 45
  148. ... (Figures 11-66 omitted for conciseness)
  149. Figure 67 : 48
  150. Figure 68 : 39
  151. Figure 69 : 39
  152. Figure 70 : 66
  153. Figure 71 : 50
  154.  
  155. Crime: 03 ,Attempts/threats to murder, assaults, harassments and related offences
  156. Figure 0 : 96
  157. Figure 1 : 89
  158. Figure 2 : 70
  159. Figure 3 : 97
  160. Figure 4 : 103
  161. Figure 5 : 103
  162.  
  163. Crime: 04 ,Dangerous or negligent acts
  164. Figure 6 : 72
  165. Figure 7 : 67
  166. Figure 8 : 50
  167. Figure 9 : 53
  168. Figure 10 : 45
  169. etc, etc
  170.  
  171. Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
  172.  
  173. import java.io.*;
  174. import org.jsoup.*;
  175. import org.jsoup.nodes.Document;
  176. import org.jsoup.nodes.Element;
  177. import org.jsoup.select.Elements;
  178.  
  179. public class ParseCrimeStatistics {
  180.  
  181. public static void main(String[]args) {
  182. try {
  183.  
  184. int count = 0;
  185. File input = new File("Balbriggan.html");
  186. Document doc =Jsoup.parse(input, "UTF-8", "http://www.cso.ie");
  187.  
  188. Elements title = doc.select("td");
  189.  
  190. for(Element sectd1:title){
  191. Elements ths = sectd1.select("td");
  192.  
  193. String result = ths.get(0).text();
  194.  
  195. System.out.println("Figure " + count + " : "+ result);
  196.  
  197. count++;
  198.  
  199. }
  200. }catch (IOException e) {
  201. e.printStackTrace();
  202. }
  203. }
  204. }
Add Comment
Please, Sign In to add comment