Update app.py
Browse files
app.py
CHANGED
@@ -33,11 +33,12 @@ def get_backlinks(api_login, api_key, target_url, filters):
|
|
33 |
if response.status_code == 200:
|
34 |
response_data = response.json()
|
35 |
|
36 |
-
# Check if 'results' key is in the response
|
37 |
if 'results' in response_data:
|
38 |
results = response_data['results']
|
39 |
if results:
|
40 |
-
#
|
|
|
|
|
41 |
df = pd.json_normalize(results)
|
42 |
return df
|
43 |
else:
|
@@ -106,7 +107,7 @@ if generate_button and target_url:
|
|
106 |
if df is not None:
|
107 |
with col2:
|
108 |
st.header("Output")
|
109 |
-
st.dataframe(df) # This
|
110 |
|
111 |
# Reset functionality
|
112 |
if reset_button:
|
|
|
33 |
if response.status_code == 200:
|
34 |
response_data = response.json()
|
35 |
|
|
|
36 |
if 'results' in response_data:
|
37 |
results = response_data['results']
|
38 |
if results:
|
39 |
+
# The line below needs to be adjusted according to the actual structure of 'results'
|
40 |
+
# For example, if results is a list of dictionaries, this should work as is.
|
41 |
+
# If the structure is more nested, you'll need to specify the path correctly.
|
42 |
df = pd.json_normalize(results)
|
43 |
return df
|
44 |
else:
|
|
|
107 |
if df is not None:
|
108 |
with col2:
|
109 |
st.header("Output")
|
110 |
+
st.dataframe(df) # This displays the DataFrame as a table
|
111 |
|
112 |
# Reset functionality
|
113 |
if reset_button:
|