Update app.py
Browse files
app.py
CHANGED
|
@@ -16,26 +16,20 @@ import pandas as pd
|
|
| 16 |
|
| 17 |
st.set_page_config(layout="wide")
|
| 18 |
|
| 19 |
-
|
| 20 |
-
loc_link = st.text_input('LOC Link', placeholder='https://www.supremecourt.gov/opinions/22pdf/21-476_c185.pdf')
|
| 21 |
-
case_num = 0
|
| 22 |
-
pdf_links = [loc_link]
|
| 23 |
-
print(pdf_links)
|
| 24 |
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
# print(pdf_links)
|
| 36 |
|
| 37 |
|
| 38 |
-
|
| 39 |
run = st.button("Run")
|
| 40 |
if run:
|
| 41 |
with st.spinner("Downloading"):
|
|
|
|
| 16 |
|
| 17 |
st.set_page_config(layout="wide")
|
| 18 |
|
| 19 |
+
# loc_link = st.text_input('LOC Link', placeholder='https://www.supremecourt.gov/opinions/22pdf/21-476_c185.pdf')
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
+
volume = st.slider('Volume', 500, 550, 525)
|
| 22 |
+
r = requests.get('https://www.loc.gov/collections/united-states-reports/?fa=partof%3Au.s.+reports%3A+volume+'+str(volume) +'&st=list&c=250')
|
| 23 |
+
soup = BeautifulSoup(r.text)
|
| 24 |
+
html_links = soup.findAll('link',attrs={'rel': 'alternate'})
|
| 25 |
+
pdf_links = []
|
| 26 |
+
for hl in html_links:
|
| 27 |
+
if len(hl['href'].split('/')[-1].split('.gif')[0])== 11:
|
| 28 |
+
pdf_links.append(hl['href'].split('.gif')[0]+'.pdf')
|
| 29 |
+
case_num = st.slider('Case Number', 0, len(pdf_links), 1, step=1)
|
| 30 |
+
print(pdf_links)
|
|
|
|
| 31 |
|
| 32 |
|
|
|
|
| 33 |
run = st.button("Run")
|
| 34 |
if run:
|
| 35 |
with st.spinner("Downloading"):
|