Omnibus commited on
Commit
d43b917
1 Parent(s): 4d3da03

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -20,16 +20,19 @@ def find_all(url,q=None,num=None):
20
  #print(soup.p)
21
  #print(soup.find_all('p'))
22
 
 
 
23
 
24
  #rawp.append([tag.name for tag in soup.find_all()] )
25
  #soup_list = [tag for tag in soup.find_all()]
26
  #for tag in soup.find_all('h1','h2','h3','p','div','ul'):
27
- for tag in soup.find_all():
28
- print (tag.get_text().name)
 
29
  #print(tag.findChildren("a" , recursive=False))
30
  #try:
31
  #n = tag.get(tag.string)
32
- #rawp.append({f'{tag.name}':tag.string,"parent":tag.parent.name})
33
  #rawp.append({tag.name:tag.string,"parent":tag.parent.name})
34
  #except Exception as e:
35
  # print (e)
 
20
  #print(soup.p)
21
  #print(soup.find_all('p'))
22
 
23
+ this = [tag.name for tag in soup.find_all()]
24
+ that = [tag.string for tag in soup.find_all()]
25
 
26
  #rawp.append([tag.name for tag in soup.find_all()] )
27
  #soup_list = [tag for tag in soup.find_all()]
28
  #for tag in soup.find_all('h1','h2','h3','p','div','ul'):
29
+ for i,tag in enumerate(soup.find_all()):
30
+
31
+ #print (tag.get_text().name)
32
  #print(tag.findChildren("a" , recursive=False))
33
  #try:
34
  #n = tag.get(tag.string)
35
+ rawp.append(this[i]:that[i])
36
  #rawp.append({tag.name:tag.string,"parent":tag.parent.name})
37
  #except Exception as e:
38
  # print (e)