Update app.py
Browse files
app.py
CHANGED
|
@@ -21,10 +21,10 @@ def find_all(url,q=None,num=None):
|
|
| 21 |
#print(soup.find_all('p'))
|
| 22 |
|
| 23 |
|
| 24 |
-
|
| 25 |
-
soup_list = [tag for tag in soup.find_all()]
|
| 26 |
#for tag in soup.find_all('h1','h2','h3','p','div','ul'):
|
| 27 |
-
for tag in soup_list:
|
| 28 |
#print(tag.findChildren("a" , recursive=False))
|
| 29 |
#try:
|
| 30 |
#n = tag.get(tag.string)
|
|
@@ -32,7 +32,7 @@ def find_all(url,q=None,num=None):
|
|
| 32 |
#rawp.append({tag.name:tag.string,"parent":tag.parent.name})
|
| 33 |
#except Exception as e:
|
| 34 |
# print (e)
|
| 35 |
-
|
| 36 |
|
| 37 |
#rawp.append(tag.string)
|
| 38 |
#for url in soup.find_all('a'):
|
|
|
|
| 21 |
#print(soup.find_all('p'))
|
| 22 |
|
| 23 |
|
| 24 |
+
rawp.append([{tag.name:tag.string} for tag in soup.find_all()] )
|
| 25 |
+
#soup_list = [tag for tag in soup.find_all()]
|
| 26 |
#for tag in soup.find_all('h1','h2','h3','p','div','ul'):
|
| 27 |
+
#for tag in soup_list:
|
| 28 |
#print(tag.findChildren("a" , recursive=False))
|
| 29 |
#try:
|
| 30 |
#n = tag.get(tag.string)
|
|
|
|
| 32 |
#rawp.append({tag.name:tag.string,"parent":tag.parent.name})
|
| 33 |
#except Exception as e:
|
| 34 |
# print (e)
|
| 35 |
+
# rawp.append({f'{tag.name}':f'{tag.string}'})
|
| 36 |
|
| 37 |
#rawp.append(tag.string)
|
| 38 |
#for url in soup.find_all('a'):
|