Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1111,7 +1111,6 @@ def fetch_and_store_data():
|
|
| 1111 |
if response.status_code == 200:
|
| 1112 |
soup = BeautifulSoup(response.content, 'html.parser')
|
| 1113 |
table = soup.find("table", {"class": "tableagmark_new"})
|
| 1114 |
-
st.write(soup.prettify())
|
| 1115 |
if table:
|
| 1116 |
headers = [th.get_text(strip=True) for th in table.find_all("th")]
|
| 1117 |
rows = [[td.get_text(strip=True) for td in row.find_all("td")] for row in table.find_all("tr")[1:]]
|
|
@@ -1186,7 +1185,6 @@ def fetch_and_store_data_market():
|
|
| 1186 |
'api_key': api_key,
|
| 1187 |
'url': full_url
|
| 1188 |
}
|
| 1189 |
-
st.write(full_url)
|
| 1190 |
|
| 1191 |
response = requests.get(api_url, params=scraperapi_params)
|
| 1192 |
|
|
@@ -1202,8 +1200,6 @@ def fetch_and_store_data_market():
|
|
| 1202 |
cells = [td.get_text(strip=True) for td in row.find_all("td")]
|
| 1203 |
if cells:
|
| 1204 |
rows.append(cells)
|
| 1205 |
-
st.write(rows)
|
| 1206 |
-
st.write(headers)
|
| 1207 |
df = pd.DataFrame(rows, columns=headers)
|
| 1208 |
df = df[df['Variety']=="White"]
|
| 1209 |
df["Price Date"] = pd.to_datetime(df["Price Date"], format='%d %b %Y', errors='coerce')
|
|
|
|
| 1111 |
if response.status_code == 200:
|
| 1112 |
soup = BeautifulSoup(response.content, 'html.parser')
|
| 1113 |
table = soup.find("table", {"class": "tableagmark_new"})
|
|
|
|
| 1114 |
if table:
|
| 1115 |
headers = [th.get_text(strip=True) for th in table.find_all("th")]
|
| 1116 |
rows = [[td.get_text(strip=True) for td in row.find_all("td")] for row in table.find_all("tr")[1:]]
|
|
|
|
| 1185 |
'api_key': api_key,
|
| 1186 |
'url': full_url
|
| 1187 |
}
|
|
|
|
| 1188 |
|
| 1189 |
response = requests.get(api_url, params=scraperapi_params)
|
| 1190 |
|
|
|
|
| 1200 |
cells = [td.get_text(strip=True) for td in row.find_all("td")]
|
| 1201 |
if cells:
|
| 1202 |
rows.append(cells)
|
|
|
|
|
|
|
| 1203 |
df = pd.DataFrame(rows, columns=headers)
|
| 1204 |
df = df[df['Variety']=="White"]
|
| 1205 |
df["Price Date"] = pd.to_datetime(df["Price Date"], format='%d %b %Y', errors='coerce')
|