#!/usr/bin/env python import re import os.path import tpcsv import cookielib import mechanize import scraper from bs4 import BeautifulSoup import data as db import time import geocode br = scraper.browser() def string_format(string): string = str(string) string = string.replace('&', ' & ') return string def put_form(): br.open('http://www.in.gov/isdh/22727.htm') br.select_form(name='the_form') br['field1'] = 'value' br['field2'] = 'value' br['field3'] = 'value' br.submit() def get_county_links(): base_url = 'http://www.in.gov' br.open('http://www.in.gov/isdh/22727.htm')