Update app2.py
Browse files
app2.py
CHANGED
@@ -1557,6 +1557,23 @@ def automated_legal_brief_generation_ui():
|
|
1557 |
mime="text/plain"
|
1558 |
)
|
1559 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1560 |
STATES = [
|
1561 |
"Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia",
|
1562 |
"Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland",
|
@@ -1618,9 +1635,17 @@ CITIES_BY_STATE = {
|
|
1618 |
"Wyoming": ["Cheyenne", "Casper", "Laramie"]
|
1619 |
}
|
1620 |
|
1621 |
-
def find_lawyers(state, city, pages=1):
|
1622 |
base_url = "https://www.justia.com/lawyers/"
|
1623 |
-
url =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1624 |
|
1625 |
headers = {
|
1626 |
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
|
@@ -1713,7 +1738,7 @@ def find_lawyers(state, city, pages=1):
|
|
1713 |
def lawyer_finder_ui():
|
1714 |
st.title("Find Lawyers in Your Area")
|
1715 |
|
1716 |
-
col1, col2 = st.columns(
|
1717 |
with col1:
|
1718 |
state = st.selectbox("Select a State:", STATES)
|
1719 |
|
@@ -1721,6 +1746,9 @@ def lawyer_finder_ui():
|
|
1721 |
cities = CITIES_BY_STATE.get(state, [])
|
1722 |
city = st.selectbox("Select a City:", cities)
|
1723 |
|
|
|
|
|
|
|
1724 |
if not city:
|
1725 |
st.warning("Please select a city to continue.")
|
1726 |
return
|
@@ -1729,7 +1757,7 @@ def lawyer_finder_ui():
|
|
1729 |
|
1730 |
if st.button("Find Lawyers", type="primary"):
|
1731 |
with st.spinner("Searching for lawyers in your area..."):
|
1732 |
-
df_lawyers = find_lawyers(state, city, pages)
|
1733 |
|
1734 |
if not df_lawyers.empty:
|
1735 |
st.success(f"Found {len(df_lawyers)} lawyers in {city}, {state}.")
|
|
|
1557 |
mime="text/plain"
|
1558 |
)
|
1559 |
|
1560 |
+
PRACTICE_AREAS = [
|
1561 |
+
"Personal Injury", "Medical Malpractice", "Criminal Law", "DUI & DWI", "Family Law",
|
1562 |
+
"Divorce", "Bankruptcy", "Business Law", "Consumer Law", "Employment Law",
|
1563 |
+
"Estate Planning", "Foreclosure Defense", "Immigration Law", "Intellectual Property",
|
1564 |
+
"Nursing Home Abuse", "Probate", "Products Liability", "Real Estate Law", "Tax Law",
|
1565 |
+
"Traffic Tickets", "Workers' Compensation", "Agricultural Law", "Animal & Dog Law",
|
1566 |
+
"Antitrust Law", "Appeals & Appellate", "Arbitration & Mediation", "Asbestos & Mesothelioma",
|
1567 |
+
"Cannabis & Marijuana Law", "Civil Rights", "Collections", "Communications & Internet Law",
|
1568 |
+
"Construction Law", "Domestic Violence", "Education Law", "Elder Law",
|
1569 |
+
"Energy, Oil & Gas Law", "Entertainment & Sports Law", "Environmental Law",
|
1570 |
+
"Gov & Administrative Law", "Health Care Law", "Insurance Claims", "Insurance Defense",
|
1571 |
+
"International Law", "Juvenile Law", "Landlord Tenant", "Legal Malpractice",
|
1572 |
+
"Maritime Law", "Military Law", "Municipal Law", "Native American Law", "Patents",
|
1573 |
+
"Securities Law", "Social Security Disability", "Stockbroker & Investment Fraud",
|
1574 |
+
"Trademarks", "White Collar Crime"
|
1575 |
+
]
|
1576 |
+
|
1577 |
STATES = [
|
1578 |
"Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia",
|
1579 |
"Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland",
|
|
|
1635 |
"Wyoming": ["Cheyenne", "Casper", "Laramie"]
|
1636 |
}
|
1637 |
|
1638 |
+
def find_lawyers(state, city=None, practice_area=None, pages=1):
|
1639 |
base_url = "https://www.justia.com/lawyers/"
|
1640 |
+
url = base_url
|
1641 |
+
|
1642 |
+
if practice_area:
|
1643 |
+
url += f"{practice_area.lower().replace(' ', '-')}/"
|
1644 |
+
|
1645 |
+
url += state.lower()
|
1646 |
+
|
1647 |
+
if city:
|
1648 |
+
url += f"/{city.lower().replace(' ', '-')}"
|
1649 |
|
1650 |
headers = {
|
1651 |
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
|
|
|
1738 |
def lawyer_finder_ui():
|
1739 |
st.title("Find Lawyers in Your Area")
|
1740 |
|
1741 |
+
col1, col2, col3 = st.columns(3)
|
1742 |
with col1:
|
1743 |
state = st.selectbox("Select a State:", STATES)
|
1744 |
|
|
|
1746 |
cities = CITIES_BY_STATE.get(state, [])
|
1747 |
city = st.selectbox("Select a City:", cities)
|
1748 |
|
1749 |
+
with col3:
|
1750 |
+
practice_area = st.selectbox("Select a Practice Area:", [""] + PRACTICE_AREAS)
|
1751 |
+
|
1752 |
if not city:
|
1753 |
st.warning("Please select a city to continue.")
|
1754 |
return
|
|
|
1757 |
|
1758 |
if st.button("Find Lawyers", type="primary"):
|
1759 |
with st.spinner("Searching for lawyers in your area..."):
|
1760 |
+
df_lawyers = find_lawyers(state, city, practice_area, pages)
|
1761 |
|
1762 |
if not df_lawyers.empty:
|
1763 |
st.success(f"Found {len(df_lawyers)} lawyers in {city}, {state}.")
|