Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,10 +7,12 @@ def run_lora(prompt,site,start,end):
|
|
7 |
page = requests.get("https://www.google.com/search?q=inurl:" +site + " " +prompt + "&tbs=cdr%3A1%2Ccd_min%3A"+start+"%2Ccd_max%3A" + end)
|
8 |
print("https://www.google.com/search?q=inurl:" +site + " " +prompt + "&tbs=cdr%3A1%2Ccd_min%3A"+start+"%2Ccd_max%3A" + end)
|
9 |
soup = BeautifulSoup(page.content)
|
|
|
10 |
import re
|
11 |
links = soup.findAll("a")
|
12 |
mLink=""
|
13 |
-
for link in
|
|
|
14 |
print (re.split(":(?=http)",link["href"].replace("/url?q=","")))
|
15 |
mLink+=str(re.split(":(?=http)",link["href"].replace("/url?q=","").replace("'","")))
|
16 |
return mLink
|
|
|
7 |
page = requests.get("https://www.google.com/search?q=inurl:" +site + " " +prompt + "&tbs=cdr%3A1%2Ccd_min%3A"+start+"%2Ccd_max%3A" + end)
|
8 |
print("https://www.google.com/search?q=inurl:" +site + " " +prompt + "&tbs=cdr%3A1%2Ccd_min%3A"+start+"%2Ccd_max%3A" + end)
|
9 |
soup = BeautifulSoup(page.content)
|
10 |
+
features="html.parser"
|
11 |
import re
|
12 |
links = soup.findAll("a")
|
13 |
mLink=""
|
14 |
+
for link in soup.find_all("a", "html.parser", parse_only=SoupStrainer('a')):
|
15 |
+
#for link in soup.find_all("a",href=re.compile("(?<=/url\?q=)(htt.*://.*)")):
|
16 |
print (re.split(":(?=http)",link["href"].replace("/url?q=","")))
|
17 |
mLink+=str(re.split(":(?=http)",link["href"].replace("/url?q=","").replace("'","")))
|
18 |
return mLink
|