Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -309,11 +309,11 @@ def find_all(purpose,task,history, url):
|
|
| 309 |
out.append(rawp)
|
| 310 |
out.append("HTML fragments: ")
|
| 311 |
q=("a","p","span","content","article")
|
| 312 |
-
for p in soup.find_all(
|
| 313 |
#cnt+=len(p.string)
|
| 314 |
#cnt+=len(p)
|
| 315 |
|
| 316 |
-
out.append([{"
|
| 317 |
c=0
|
| 318 |
out = str(out)
|
| 319 |
rl = len(out)
|
|
@@ -321,8 +321,8 @@ def find_all(purpose,task,history, url):
|
|
| 321 |
print(f'rl:: {rl}')
|
| 322 |
#for ea in out:
|
| 323 |
for i in str(out):
|
| 324 |
-
if i == " " or i=="," or i=="\n":
|
| 325 |
-
|
| 326 |
print (f'c:: {c}')
|
| 327 |
if c > MAX_DATA:
|
| 328 |
print("compressing...")
|
|
|
|
| 309 |
out.append(rawp)
|
| 310 |
out.append("HTML fragments: ")
|
| 311 |
q=("a","p","span","content","article")
|
| 312 |
+
for p in soup.find_all("a"):
|
| 313 |
#cnt+=len(p.string)
|
| 314 |
#cnt+=len(p)
|
| 315 |
|
| 316 |
+
out.append([{"LINK TITLE":p.title,"URL":p.href}])
|
| 317 |
c=0
|
| 318 |
out = str(out)
|
| 319 |
rl = len(out)
|
|
|
|
| 321 |
print(f'rl:: {rl}')
|
| 322 |
#for ea in out:
|
| 323 |
for i in str(out):
|
| 324 |
+
#if i == " " or i=="," or i=="\n":
|
| 325 |
+
c +=1
|
| 326 |
print (f'c:: {c}')
|
| 327 |
if c > MAX_DATA:
|
| 328 |
print("compressing...")
|