Update fn.py
Browse files
fn.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import os
|
2 |
|
3 |
from duckduckgo_search import DDGS
|
4 |
-
|
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 =
|
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
|