aka7774 commited on
Commit
5a2da72
·
verified ·
1 Parent(s): c1c439f

Update fn.py

Browse files
Files changed (1) hide show
  1. fn.py +2 -2
fn.py CHANGED
@@ -1,7 +1,7 @@
1
  import os
2
 
3
  from duckduckgo_search import DDGS
4
- from urllib.request import urlopen
5
  from bs4 import BeautifulSoup
6
 
7
  def run(text):
@@ -16,7 +16,7 @@ def ddg(text, max_results = 5):
16
  return results
17
 
18
  def bs4(url):
19
- html = urlopen(url).read()
20
  soup = BeautifulSoup(html, features="html.parser")
21
 
22
  # kill all script and style elements
 
1
  import os
2
 
3
  from duckduckgo_search import DDGS
4
+ import requests
5
  from bs4 import BeautifulSoup
6
 
7
  def run(text):
 
16
  return results
17
 
18
  def bs4(url):
19
+ html = requests.get(url).text
20
  soup = BeautifulSoup(html, features="html.parser")
21
 
22
  # kill all script and style elements