Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import gradio as gr
|
|
| 3 |
from bs4 import BeautifulSoup
|
| 4 |
from rich import print
|
| 5 |
from urllib.parse import urlparse
|
| 6 |
-
|
| 7 |
from googlesearch import search
|
| 8 |
from urllib.parse import parse_qs
|
| 9 |
|
|
@@ -21,7 +21,7 @@ def run_lora(prompt,site,start,end):
|
|
| 21 |
soup = BeautifulSoup(page.text, 'html.parser')
|
| 22 |
search_results = []
|
| 23 |
#MjjYud
|
| 24 |
-
for g in soup.find_all('div',
|
| 25 |
print(g)
|
| 26 |
title = g.find('h3').text if g.find('h3') else 'No title'
|
| 27 |
link = g.find('a')['href']
|
|
|
|
| 3 |
from bs4 import BeautifulSoup
|
| 4 |
from rich import print
|
| 5 |
from urllib.parse import urlparse
|
| 6 |
+
import re
|
| 7 |
from googlesearch import search
|
| 8 |
from urllib.parse import parse_qs
|
| 9 |
|
|
|
|
| 21 |
soup = BeautifulSoup(page.text, 'html.parser')
|
| 22 |
search_results = []
|
| 23 |
#MjjYud
|
| 24 |
+
for g in soup.find_all('div',class_=re.compile(r'tF2Cxc')):
|
| 25 |
print(g)
|
| 26 |
title = g.find('h3').text if g.find('h3') else 'No title'
|
| 27 |
link = g.find('a')['href']
|