The beginning of the relevant data (the only data that is needed out of the entire html file for the purpose of extracting relevant data points) is always identified by the following:
<div id="mpa-roa-case-events-content"

Each 'Case Event' is identified by the following string/code:
<div class="mpa-case-details-party-item mpa-border-bottom-gray-gainsboro">

The script needs to output the 'Total Case Events' which could be figured out manually by a person simply hitting 'ctrl + f' to search the relevant html code for '<div class="mpa-case-details-party-item mpa-border-bottom-gray-gainsboro">' and seeing how many string matches it finds

The script needs to output 'Max Index #' where each index number that exists in the relevant html code is structure as:  'Index #13'   

There are no leading zeros for any of the index numbers. The lowest index number will always be 'Index #1' - the script determines what 'Max Index #' equals simply by finding the largest 'Index #' value - which will always be the very first 'Index #' that the script is able to find based on the assumption that it starts at the 'top' of the html code/rows/page and is moving downward towards the last row. The lowest index number ('Index #1'..) will always be the last index at the very 'lowest' row (in terms of 'low' and 'high' referring to a persons view of the 'page' or computer monitor..) in the html code - so each 'Index #' simply increases by a simple count/sequential integer sum. The 'Max Index #' could also be thought of or even calculated and determined much easier simply by having the script conduct a search for the string '<span>Index #' and then determining what the value for the first '<span>Index #' found is WHERE the 'first' simply means the one closest to the top of the page (the lowest row number value..) - the 'complete' / 'total' code for ALL index numbers is the following -   <span>Index #162</span>    - This is the ONLY text/code that will occupy that entire row  - so the script would simply find the string '<span>Index #' that resides on the lowest row number (actual row value..so the 'top' of the page..) and the 'Max Index #' is ALWAYS the digits AFTER the '<span>Index #' string and BEFORE the '</span>' string.

For each 'Case Event' that is contained within the relevant html code I need to extract the 'Event Name' that is associated (contained within the <div> wrappers..) of each one

	'Event Name' -
	
		There will be an 'Event Name' for ALL 'Case Events' no matter what. The event name in the following code 'sample'/'example' provided below should be output as 'Notice of Motion and Motion' - The event name is ALWAYS identified by '<div class="row mpa-print-bs-row-flex">' insofar as knowing that once the script finds this string/code that the event name will always be below it and contained within the 'span' tags as shown below
		
			<div class="row mpa-print-bs-row-flex">
				<div class="col-12 col-lg-8 mb-2 mb-lg-0 mpa-print-bs-mb-0">
					<span>Notice of Motion and Motion</span>                     <~~~~~This contains the 'Event Name' where the 'Event Name' would equal 'Notice of Motion and Motion' - so the second row after the '<div class="row mpa-print-bs-row-flex">' string is found...

		FOR EACH 'Event Name' that is output (so the total number of 'Event Names' will alwyas equal the 'Total Case Events' output - which again is simply a 'total count' integer..) I need to know two things: 
			
			1 - Is there an 'Index #' associated/included as part of it? 0/1....y/n.. This is a simple boolean...so either '0' or '1' for 'Is Index?' column
			2 - Is there a 'View Document' associated as part of it?  This is also another boolean. So either '0' or '1' for the 'Is Document?' column

				IF there is an 'Index #' it will directly follow after the 'Event Name' like the following: 

                    			<div class="row mpa-print-bs-row-flex">
                       			 <div class="col-12 col-lg-8 mb-2 mb-lg-0 mpa-print-bs-mb-0">
                         		   <span>Notice of Motion and Motion</span>
                           		     <div class="mpa-case-event-text-wrapper">     <~~~~~Not every 'Case Name' will contain this divClass/wrapper....not every divClass/Wrapper will have an 'Index #' following it as sometimes it is used for other text items BUT...IF there is an 'Index #' after the divClass/Wrapper string that is shown on this row it will ALWAYS maintain the same string - just like we previously discussed for the purpose of figuring out the 'Max Index #' variable. So whatever works to arrive at the simple '0' or '1' boolean output that answers the question "Does an Index # exist for this 'Event Name'?"
                              		      <span>Index #13</span>

				IF 'View Document' exists the body of the 'Case Event' code will contain the following string -  '<span>View Document</span>'   IF the string does NOT exist AFTER the 'Event Name' and BEFORE the next 'Case Event' is identified/reached ('<div class="mpa-case-details-party-item mpa-border-bottom-gray-gainsboro">') THEN 'Is Document?' = '0'
				


So the script only needs to output a total of 3 columns - Name, Value0, and Value1     These column names should not be included in the output and are only provided for reference / explaining
The first column will contain all of the names
The first two rows of the first column will always contain 'Total Case Events' followed by 'Max Index #'  - The value for each of these will go in column 2 and column 3 will be empty ONLY for the first two rows. All rows that follow must contain either a '0' or a '1' in column 1 and column two as determined by the criteria covered previously for each 'Event Name'
The total number of rows in the output csv file == ('Total Case Events' + 2)
Column 1 of every row after the first two needs to have the name/string FOR EACH 'Event Name' added to it. Column 2 will contain the 'Is Index?' boolean, column 3 will contain the 'Is Document?' boolean


The keep things simple lets have the scripts 'directory' variable be determined from the directory that the script is ran from / contained within.
Besides the 'Script.py' file the ONLY other files within the directory before the script is run will ALWAYS be .html files which are ALWAYS named with sequential digits with the initial or '1st' file always being '01.html', '02.html' , '03'....etc...etc....
FOR EACH .html file in the directory the script needs to output a .csv file that matches the .html name - so '01.csv', '02.csv', etc. etc. etc.

the script is complete when each .html file in the directory has been processed and has a matching .csv file which contains the data.



