Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,35 +16,7 @@ def find_all(url,q=None,num=None):
|
|
16 |
print(soup.title.string)
|
17 |
# beginning navigation:
|
18 |
print(soup.title.parent.name)
|
19 |
-
|
20 |
-
#print(soup.p)
|
21 |
-
#print(soup.find_all('p'))
|
22 |
-
|
23 |
-
this = [tag.name for tag in soup.find_all()]
|
24 |
-
that = [tag.text for tag in soup.find_all()]
|
25 |
-
|
26 |
-
#rawp.append([tag.name for tag in soup.find_all()] )
|
27 |
-
#soup_list = [tag for tag in soup.find_all()]
|
28 |
-
#for tag in soup.find_all('h1','h2','h3','p','div','ul'):
|
29 |
-
for i,tag in enumerate(this):
|
30 |
-
|
31 |
-
#print (tag.get_text().name)
|
32 |
-
#print(tag.findChildren("a" , recursive=False))
|
33 |
-
#try:
|
34 |
-
#n = tag.get(tag.string)
|
35 |
-
rawp.append({this[i]:that[i]})
|
36 |
-
#rawp.append({tag.name:tag.string,"parent":tag.parent.name})
|
37 |
-
#except Exception as e:
|
38 |
-
# print (e)
|
39 |
-
# rawp.append({f'{tag.name}':f'{tag.string}'})
|
40 |
-
|
41 |
-
#rawp.append(tag.string)
|
42 |
-
#for url in soup.find_all('a'):
|
43 |
-
#print(url.get('href'))
|
44 |
-
|
45 |
-
#print(soup.get_text())
|
46 |
-
|
47 |
-
|
48 |
return rawp
|
49 |
|
50 |
|
|
|
16 |
print(soup.title.string)
|
17 |
# beginning navigation:
|
18 |
print(soup.title.parent.name)
|
19 |
+
rawp.append([tag.name for tag in soup.find_all()] )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
return rawp
|
21 |
|
22 |
|