cools commited on
Commit
8591fa2
·
1 Parent(s): 89c98c3

Update app.py

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