Roberta2024 commited on
Commit
f7e5a09
1 Parent(s): b67af9e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -22
app.py CHANGED
@@ -2,7 +2,7 @@ import streamlit as st
2
  import requests
3
  from bs4 import BeautifulSoup
4
  import pandas as pd
5
- import base64
6
 
7
  # Function to set background image
8
  def set_background(image_file):
@@ -23,6 +23,9 @@ def set_background(image_file):
23
  # Set the background image
24
  set_background('ddog.png')
25
 
 
 
 
26
  # Streamlit app title
27
  st.title('寵物診所資訊爬蟲')
28
 
@@ -30,27 +33,7 @@ st.title('寵物診所資訊爬蟲')
30
  urls = [
31
  'https://www.tw-animal.com/pet/171211/c000196.html',
32
  'https://www.tw-animal.com/pet/171211/c000186.html',
33
- 'https://www.tw-animal.com/pet/171211/c000081.html',
34
- 'https://www.tw-animal.com/pet/171211/c000848.html',
35
- 'https://www.tw-animal.com/pet/171211/c000045.html',
36
- 'https://www.tw-animal.com/pet/171211/c001166.html',
37
- 'https://www.tw-animal.com/pet/171211/c000773.html',
38
- 'https://www.tw-animal.com/pet/171211/c001038.html',
39
- 'https://www.tw-animal.com/pet/171211/c000741.html',
40
- 'https://www.tw-animal.com/pet/171211/c001451.html',
41
- 'https://www.tw-animal.com/pet/171211/c000102.html',
42
- 'https://www.tw-animal.com/pet/171211/c000757.html',
43
- 'https://www.tw-animal.com/pet/171211/c000703.html',
44
- 'https://www.tw-animal.com/pet/171211/c000481.html',
45
- 'https://www.tw-animal.com/pet/171211/c000971.html',
46
- 'https://www.tw-animal.com/pet/171211/c000187.html',
47
- 'https://www.tw-animal.com/pet/171211/c001357.html',
48
- 'https://www.tw-animal.com/pet/171211/c001065.html',
49
- 'https://www.tw-animal.com/pet/171211/c000165.html',
50
- 'https://www.tw-animal.com/pet/171211/c000217.html',
51
- 'https://www.tw-animal.com/pet/171211/c000802.html',
52
- 'https://www.tw-animal.com/pet/171211/c001034.html',
53
- 'https://www.tw-animal.com/pet/171211/c001453.html'
54
  ]
55
 
56
  # 讓使用者輸入評分門檻
 
2
  import requests
3
  from bs4 import BeautifulSoup
4
  import pandas as pd
5
+ import base64 # This is a built-in module, no need to install
6
 
7
  # Function to set background image
8
  def set_background(image_file):
 
23
  # Set the background image
24
  set_background('ddog.png')
25
 
26
+ # Rest of the code remains the same
27
+ # ...
28
+
29
  # Streamlit app title
30
  st.title('寵物診所資訊爬蟲')
31
 
 
33
  urls = [
34
  'https://www.tw-animal.com/pet/171211/c000196.html',
35
  'https://www.tw-animal.com/pet/171211/c000186.html',
36
+ # ... (rest of the URLs)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  ]
38
 
39
  # 讓使用者輸入評分門檻