Omnibus commited on
Commit
198d5cc
·
1 Parent(s): b1f7486

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -14
app.py CHANGED
@@ -305,22 +305,23 @@ def find_all(purpose,task,history, url):
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([{p.name:p.string,"parent":p.parent.name,"previous":p.previous,"first-child":[b.name for b in p.children],"content":p}])
312
- c=0
313
- out = str(out)
314
- rl = len(out)
315
- print(f'rl:: {rl}')
316
- #for ea in out:
317
- for i in str(out):
318
- if i == " " or i=="," or i=="\n":
319
- c +=1
320
- print (f'c:: {c}')
 
321
  if rl > MAX_DATA:
322
  print("compressing...")
323
- rawp = compress_data(c,purpose,task,out)
324
  print (rawp)
325
  print (f'out:: {out}')
326
  history += "observation: the search results are:\n {}\n".format(out)
 
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([{p.name:p.string,"parent":p.parent.name,"previous":p.previous,"first-child":[b.name for b in p.children],"content":p}])
312
+ #c=0
313
+ #out = str(out)
314
+ #rl = len(out)
315
+ #print(f'rl:: {rl}')
316
+ ##for ea in out:
317
+ #for i in str(out):
318
+ # if i == " " or i=="," or i=="\n":
319
+ # c +=1
320
+ #print (f'c:: {c}')
321
+ rl=len(rawp)
322
  if rl > MAX_DATA:
323
  print("compressing...")
324
+ rawp = compress_data(rl,purpose,task,out)
325
  print (rawp)
326
  print (f'out:: {out}')
327
  history += "observation: the search results are:\n {}\n".format(out)