Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -299,16 +299,17 @@ def find_all(purpose,task,history, url):
|
|
299 |
# get attributes:
|
300 |
print(soup.title.name)
|
301 |
# get values:
|
302 |
-
print(soup.title.string)
|
303 |
# beginning navigation:
|
304 |
-
print(soup.title.parent.name)
|
305 |
#rawp.append([tag.name for tag in soup.find_all()] )
|
306 |
-
print([tag.name for tag in soup.find_all()])
|
307 |
rawp=(f'RAW TEXT RETURNED: {soup.text}')
|
308 |
out.append(rawp)
|
|
|
309 |
q=("a","p","span","content","article")
|
310 |
for p in soup.find_all(q):
|
311 |
-
out.append([{
|
312 |
c=0
|
313 |
out = str(out)
|
314 |
rl = len(out)
|
|
|
299 |
# get attributes:
|
300 |
print(soup.title.name)
|
301 |
# get values:
|
302 |
+
#print(soup.title.string)
|
303 |
# beginning navigation:
|
304 |
+
#print(soup.title.parent.name)
|
305 |
#rawp.append([tag.name for tag in soup.find_all()] )
|
306 |
+
#print([tag.name for tag in soup.find_all()])
|
307 |
rawp=(f'RAW TEXT RETURNED: {soup.text}')
|
308 |
out.append(rawp)
|
309 |
+
out.append("HTML fragments: ")
|
310 |
q=("a","p","span","content","article")
|
311 |
for p in soup.find_all(q):
|
312 |
+
out.append([{"string":p.string,"content":p])
|
313 |
c=0
|
314 |
out = str(out)
|
315 |
rl = len(out)
|