Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,7 +20,8 @@ def link_find(url):
|
|
| 20 |
q=("a","p","span","content","article")
|
| 21 |
for p in soup.find_all("a"):
|
| 22 |
node1['TREE'].append({"URL":p.get('href'),"TITLE":p.get('title'),"STRING":p.string,"TEXT":"","TREE":[]})
|
| 23 |
-
|
|
|
|
| 24 |
else:
|
| 25 |
pass
|
| 26 |
return [node1]
|
|
@@ -41,7 +42,7 @@ def sitemap(url,level):
|
|
| 41 |
uri=f'{uri1}//{uri3}'
|
| 42 |
print(uri)
|
| 43 |
out_list=link_find(f"{uri}{ea['URL']}")
|
| 44 |
-
link1[i]['TREE']=out_list
|
| 45 |
if level>=3:
|
| 46 |
for n,na in enumerate(link1[i]['TREE']):
|
| 47 |
print(na)
|
|
@@ -53,7 +54,7 @@ def sitemap(url,level):
|
|
| 53 |
uri0=f'{uri11}//{uri33}'
|
| 54 |
print(uri0)
|
| 55 |
out_list1=link_find(f"{uri0}{na['URL']}")
|
| 56 |
-
link1[i]['TREE'][n]['TREE']=out_list1
|
| 57 |
except Exception as e:
|
| 58 |
print (e)
|
| 59 |
except Exception as e:
|
|
|
|
| 20 |
q=("a","p","span","content","article")
|
| 21 |
for p in soup.find_all("a"):
|
| 22 |
node1['TREE'].append({"URL":p.get('href'),"TITLE":p.get('title'),"STRING":p.string,"TEXT":"","TREE":[]})
|
| 23 |
+
#out.append({"URL":p.get('href'),"TITLE":p.get('title'),"STRING":p.string,"TEXT":"","TREE":[]})
|
| 24 |
+
|
| 25 |
else:
|
| 26 |
pass
|
| 27 |
return [node1]
|
|
|
|
| 42 |
uri=f'{uri1}//{uri3}'
|
| 43 |
print(uri)
|
| 44 |
out_list=link_find(f"{uri}{ea['URL']}")
|
| 45 |
+
#link1[i]['TREE']=out_list
|
| 46 |
if level>=3:
|
| 47 |
for n,na in enumerate(link1[i]['TREE']):
|
| 48 |
print(na)
|
|
|
|
| 54 |
uri0=f'{uri11}//{uri33}'
|
| 55 |
print(uri0)
|
| 56 |
out_list1=link_find(f"{uri0}{na['URL']}")
|
| 57 |
+
#link1[i]['TREE'][n]['TREE']=out_list1
|
| 58 |
except Exception as e:
|
| 59 |
print (e)
|
| 60 |
except Exception as e:
|