Omnibus commited on
Commit
1be9d96
·
verified ·
1 Parent(s): 755085d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
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([{q:p.string,"parent":p.parent.name,"previous":[b for b in p.previous],"first-child":[b.name for b in p.children],"content":p}])
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)