cools commited on
Commit
c65f678
·
1 Parent(s): 363f9f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -17
app.py CHANGED
@@ -16,26 +16,20 @@ import pandas as pd
16
 
17
  st.set_page_config(layout="wide")
18
 
19
- with st.expander("Direct Link"):
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
- # with st.expander("US. Reports Case Pull"):
26
- # volume = st.slider('Volume', 500, 550, 525)
27
- # r = requests.get('https://www.loc.gov/collections/united-states-reports/?fa=partof%3Au.s.+reports%3A+volume+'+str(volume) +'&st=list&c=250')
28
- # soup = BeautifulSoup(r.text)
29
- # html_links = soup.findAll('link',attrs={'rel': 'alternate'})
30
- # pdf_links = []
31
- # for hl in html_links:
32
- # if len(hl['href'].split('/')[-1].split('.gif')[0])== 11:
33
- # pdf_links.append(hl['href'].split('.gif')[0]+'.pdf')
34
- # case_num = st.slider('Case Number', 0, len(pdf_links), 1, step=1)
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"):