Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -17,12 +17,12 @@ def find_all(url,q=None,num=None):
|
|
17 |
# beginning navigation:
|
18 |
print(soup.title.parent.name)
|
19 |
# getting specific values:
|
20 |
-
print(soup.p)
|
21 |
-
print(soup.find_all('p'))
|
22 |
for tag in soup.find_all():
|
23 |
-
print(tag.findChildren("a" , recursive=False))
|
24 |
try:
|
25 |
-
n = tag.get(tag.string)
|
26 |
rawp.append({tag.name:tag.string,"parent":tag.parent.name})
|
27 |
except Exception as e:
|
28 |
print (e)
|
@@ -32,7 +32,7 @@ def find_all(url,q=None,num=None):
|
|
32 |
for url in soup.find_all('a'):
|
33 |
print(url.get('href'))
|
34 |
|
35 |
-
print(soup.get_text())
|
36 |
|
37 |
|
38 |
return rawp
|
@@ -43,7 +43,7 @@ def find_it(url,q=None,num=None):
|
|
43 |
source = urllib.request.urlopen(url).read()
|
44 |
soup = bs4.BeautifulSoup(source,'lxml')
|
45 |
for p in soup.find_all(f'{q}'):
|
46 |
-
print(p.findChildren())
|
47 |
|
48 |
#out.append(p)
|
49 |
out.append([{q:p.string,"parent":p.parent.name}])
|
|
|
17 |
# beginning navigation:
|
18 |
print(soup.title.parent.name)
|
19 |
# getting specific values:
|
20 |
+
#print(soup.p)
|
21 |
+
#print(soup.find_all('p'))
|
22 |
for tag in soup.find_all():
|
23 |
+
print(tag.findChildren("a" , recursive=False).name)
|
24 |
try:
|
25 |
+
#n = tag.get(tag.string)
|
26 |
rawp.append({tag.name:tag.string,"parent":tag.parent.name})
|
27 |
except Exception as e:
|
28 |
print (e)
|
|
|
32 |
for url in soup.find_all('a'):
|
33 |
print(url.get('href'))
|
34 |
|
35 |
+
#print(soup.get_text())
|
36 |
|
37 |
|
38 |
return rawp
|
|
|
43 |
source = urllib.request.urlopen(url).read()
|
44 |
soup = bs4.BeautifulSoup(source,'lxml')
|
45 |
for p in soup.find_all(f'{q}'):
|
46 |
+
print(p.findChildren().name)
|
47 |
|
48 |
#out.append(p)
|
49 |
out.append([{q:p.string,"parent":p.parent.name}])
|