johann22 commited on
Commit
a41df26
1 Parent(s): fa57097

Update i_search.py

Browse files
Files changed (1) hide show
  1. i_search.py +2 -0
i_search.py CHANGED
@@ -16,9 +16,11 @@ def i_search(url):
16
  try:
17
  response.raise_for_status()
18
  soup = BeautifulSoup(response.content, 'html.parser')
 
19
  out = ' '.join([p.text for p in soup.find_all('p')])
20
  if out == "" or out == None:
21
  out = ' '.join([p.text for p in soup.find_all('article')])
 
22
  return out
23
  except Exception as e:
24
  print (e)
 
16
  try:
17
  response.raise_for_status()
18
  soup = BeautifulSoup(response.content, 'html.parser')
19
+ out = 'URL Links:\n'.join([p.text for p in soup.find_all('a')])
20
  out = ' '.join([p.text for p in soup.find_all('p')])
21
  if out == "" or out == None:
22
  out = ' '.join([p.text for p in soup.find_all('article')])
23
+
24
  return out
25
  except Exception as e:
26
  print (e)