Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,14 +13,15 @@ def run_lora(prompt,site,start,end):
|
|
| 13 |
# to search
|
| 14 |
page = requests.get("https://www.google.com/search?q=inurl:" +site + " " +prompt + "&tbs=cdr%3A1%2Ccd_min%3A"+start+"%2Ccd_max%3A" + end)
|
| 15 |
print("https://www.google.com/search?q=inurl:" +site + " " +prompt + "&tbs=cdr%3A1%2Ccd_min%3A"+start+"%2Ccd_max%3A" + end)
|
| 16 |
-
|
| 17 |
-
|
| 18 |
import re
|
| 19 |
links = soup.findAll("a")
|
| 20 |
mLink=""
|
| 21 |
-
for link in
|
| 22 |
-
|
| 23 |
-
|
|
|
|
| 24 |
return mLink
|
| 25 |
|
| 26 |
with gr.Blocks() as app:
|
|
|
|
| 13 |
# to search
|
| 14 |
page = requests.get("https://www.google.com/search?q=inurl:" +site + " " +prompt + "&tbs=cdr%3A1%2Ccd_min%3A"+start+"%2Ccd_max%3A" + end)
|
| 15 |
print("https://www.google.com/search?q=inurl:" +site + " " +prompt + "&tbs=cdr%3A1%2Ccd_min%3A"+start+"%2Ccd_max%3A" + end)
|
| 16 |
+
soup = BeautifulSoup(page.content)
|
| 17 |
+
features="html.parser"
|
| 18 |
import re
|
| 19 |
links = soup.findAll("a")
|
| 20 |
mLink=""
|
| 21 |
+
#for link in soup.find_all("a", "html.parser", parse_only=SoupStrainer('a')):
|
| 22 |
+
for link in soup.find_all("a","html.parser",href=re.compile("(?<=/url\?q=)(htt.*://.*)")):
|
| 23 |
+
print (re.split(":(?=http)",link["href"].replace("/url?q=","")))
|
| 24 |
+
mLink+=str(re.split(":(?=http)",link["href"].replace("/url?q=","").replace("'","")))
|
| 25 |
return mLink
|
| 26 |
|
| 27 |
with gr.Blocks() as app:
|