This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| prestring=['MugShotWidget2.serverResponse([\' <div class="ms_outer_container"><a href="http://www.tampabay.com/mugshots/" target="_blank"><img src="http://mugshots.s3.amazonaws.com/site-images/widget-header.gif" alt="Tampa Bay Mug Shots" /></a><div class="ms_toptext">Meet the latest eight people booked in Pinellas, Hillsborough, Manatee and Pasco counties.</div>'] | |
| poststring=[] | |
| for each in mugs: | |
| pair = "%s %s" % (each.first_name, each.last_name) | |
| poststring.append('<a href="http://www.tampabay.com/mugshots/" target="_blank"><img class="ms_mug" src="%s" title="%s" alt="%s" /></a>' % (each.signed_photo, pair, pair)) | |
| for each in poststring: | |
| prestring.append(each) | |
| widget = "".join(prestring)+"\'])" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| def kml_fixer(DIRECTORY, FILENAME): | |
| file_in=DIRECTORY+'/'+FILENAME | |
| file_out=DIRECTORY+'/NEW_'+FILENAME | |
| with open(file_in, "r+") as f: | |
| old = f.read() | |
| x = re.findall(r'<Point>\n.*\n.*<\/Point>', old) | |
| for each in x: | |
| old = old.replace(each, "") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from bs4 import BeautifulSoup | |
| import requests | |
| import csv | |
| url = "http://www.crimemapping.com/DetailedReport.aspx?db=1/12/2012+00:00:00&de=1/25/2012+23:59:00&ccs=AR,AS,BU,DP,DR,DU,FR,HO,VT,RO,SX,TH,VA,VB,WE&xmin=-8577539.984326074&ymin=4369220.056681086&xmax=-8402193.441439813&ymax=4444739.840626868&faid=0b80bce5-5d21-468b-ae81-3d6e2ecf532e" | |
| r = requests.get(url) | |
| soup = BeautifulSoup(r.text) | |
| table = soup.findAll('table')[0] | |
| crimelist = [] | |
| for row in table.findAll('tr')[1:]: |
NewerOlder