How to scrape data from the following website to find specific case details?
Here are the manual steps to find case details:
- Navigate to https://www.claytoncountyga.gov/government/courts/court-case-inquiry/
- It seems there may be a JavaScript loading form with a button/input that allows you to drill down to further case details - "Name Search" needs to be selected to search cases by last name - click on it
- A new screen then appears in the same element as (2), allowing the user to select from a drop-down court (e.g. Magistrates Court) and enter a first and last name (Smith John) via free-form text input.
- Click "Submit" to view all cases
- The case details can be viewed by clicking on the case number on one of the rows populated in the same element in the table as in all previous steps - I want to scrape the data from this page.
Because the inner form appears to be encapsulated (I'm guessing implemented in Javascript), I can't see the HTML elements that are rendered after each input is provided. How do I automate using Python?
The form is contained within an
iframe
with the ID "Clayton County". In order for selenium to interact with elements within it, we first have to switch to it using theEC.frame_to_be_available_and_switch_to_it
method.Then using
Select()
we can select an option from the drop down menu.In the last page we get all the case number urls and save them in
case_numbers_urls
so that we can loop through them, load each case, get the information and pass it to the next case.