4736
Comments (220)
sorted by:
You're viewing a single comment thread. View all comments, or full comment thread.
145
TheBaconStopsHere 145 points ago +145 / -0

I wrote a Python script that loops over months and tests if it was registered:

import requests

first_name = 'Eleanor'
last_name = 'Guest'
birth_year = 1900
zip_code = 48239

for i in range(12):
    payload = {
        'FirstName': first_name,
        'LastName': last_name,
        'NameBirthMonth': i + 1,
        'NameBirthYear': birth_year,
        'ZipCode': zip_code,
        'Dln': '',
        'DlnBirthMonth': 0,
        'DlnBirthYear': '',
        'DpaID': 0,
        'Month': '',
        'VoterNotFound': 'false',
        'TransitionVoter': 'false'
    }

    response = requests.post('https://vote.michigan.gov/Voter/SearchByName', data=payload)

    if 'Yes, you are registered!' in response.text:
        print('found registration in month {}'.format(i + 1))
        break

If anyone can figure out how to scrape the results from Google then it could be built into this and we could maybe pull a data dump.

28
Charliecharlie 28 points ago +28 / -0

So update for the code.. It looks like the michiganvoters info site categorizes its pages like this: f100001 for the first page of last names starting with F. similarly, for every letter of the alphabet you can do a100001 dot html alll the way to z100001 dot html. Using this I was able to iterate through the list confidently. You can count the number 100001 up until no page is found and thats how you know no one else has a last name starting at that point in the alphabet.

Here is some regex python code you can use that will give you the name of everyone on the list for whatever page you are at. Add this to your code and then you can search each person whos year is whatever you want.

import pandas as pd import requests import re import string

test = requests.get("https://michiganvoters.info/by_name/pages/f100001.html") new = str(test.content).replace("<br>", '\n')

response = requests.get("https://michiganvoters.info/by_name/pages/f100001.html") new = str(test.content).replace("<br>", '\n') person_list = re.findall("\n.*\swas\sborn\sin\s\d{4}\sand\she.*United\sStates\s",new)

for person in person_list:

person_nfo = re.findall("\n\w[a-zA-Z]*,\s\w[a-zA-Z]*",person)

name = person_nfo[0].replace("\n","")

year = re.findall("in\s\d{4}",person)


print(name)
print(year)
16
LetoAtreides 16 points ago +16 / -0

You can download the whole database as a csv. Am I missing something? Did that thisorning and loaded it to MariaDB to make it easier to search.