Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,7 +17,7 @@ def find_all(url,q=None,num=None):
|
|
| 17 |
# beginning navigation:
|
| 18 |
print(soup.title.parent.name)
|
| 19 |
#rawp.append([tag.name for tag in soup.find_all()] )
|
| 20 |
-
print([
|
| 21 |
return rawp
|
| 22 |
|
| 23 |
|
|
@@ -29,14 +29,15 @@ def find_it(url,q=None,num=None):
|
|
| 29 |
for p in soup.find_all(f'{q}'):
|
| 30 |
try:
|
| 31 |
test = soup.select(f'{p.name}:first-child')
|
| 32 |
-
|
| 33 |
#print(p.findChildren())
|
| 34 |
except Exception as e:
|
| 35 |
print (e)
|
| 36 |
#out.append(p)
|
| 37 |
-
out.append([{q:p.string,"parent":p.parent.
|
| 38 |
#out.append(p.parent.name)
|
| 39 |
-
|
|
|
|
| 40 |
for url in soup.find_all('a'):
|
| 41 |
print(url.get('href'))
|
| 42 |
|
|
|
|
| 17 |
# beginning navigation:
|
| 18 |
print(soup.title.parent.name)
|
| 19 |
#rawp.append([tag.name for tag in soup.find_all()] )
|
| 20 |
+
print([tag.name for tag in soup.find_all()])
|
| 21 |
return rawp
|
| 22 |
|
| 23 |
|
|
|
|
| 29 |
for p in soup.find_all(f'{q}'):
|
| 30 |
try:
|
| 31 |
test = soup.select(f'{p.name}:first-child')
|
| 32 |
+
|
| 33 |
#print(p.findChildren())
|
| 34 |
except Exception as e:
|
| 35 |
print (e)
|
| 36 |
#out.append(p)
|
| 37 |
+
out.append([{q:p.string,"parent":p.parent.name,"first-child":soup.select(f'{p.name}:first-child'),"content":p}])
|
| 38 |
#out.append(p.parent.name)
|
| 39 |
+
print(dir(p))
|
| 40 |
+
print(p.parent)
|
| 41 |
for url in soup.find_all('a'):
|
| 42 |
print(url.get('href'))
|
| 43 |
|