adpro commited on
Commit
3ef2177
·
verified ·
1 Parent(s): 593aec9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -14,8 +14,13 @@ def run_lora(prompt,site,start,end):
14
 
15
  page = requests.get(j, headers = {'User-agent': 'your bot 0.1'})
16
  soup = BeautifulSoup(page.content,"html.parser")
17
- mj = extract_results(soup)
18
- print(mj)
 
 
 
 
 
19
  def extract_results(soup):
20
  main = soup.select_one("#main")
21
 
 
14
 
15
  page = requests.get(j, headers = {'User-agent': 'your bot 0.1'})
16
  soup = BeautifulSoup(page.content,"html.parser")
17
+ import re
18
+ links = soup.findAll("a")
19
+ mLink=""
20
+ #for link in soup.find_all("a", "html.parser", parse_only=SoupStrainer('a')):
21
+ for link in soup.find_all("a","html.parser",href=re.compile("(?<=/url\?q=)(htt.*://.*)")):
22
+ print (re.split(":(?=http)",link["href"].replace("/url?q=","")))
23
+ mLink+=str(re.split(":(?=http)",link["href"].replace("/url?q=","").replace("'","")))
24
  def extract_results(soup):
25
  main = soup.select_one("#main")
26