adpro commited on
Commit
3d1a42b
·
verified ·
1 Parent(s): 5bb3dc8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -15,14 +15,11 @@ def run_lora(prompt,site,start,end):
15
  soup = BeautifulSoup(response.content)
16
  # Tìm tất cả các liên kết trong kết quả tìm kiếm
17
  results = soup.find_all('a')
18
-
19
  # Lọc và hiển thị các liên kết
20
- for link in results:
21
- href = link.get('href')
22
- if href and href.startswith('/url?q='):
23
- # Loại bỏ prefix '/url?q=' và tham số URL không cần thiết
24
- full_url = href.split('/url?q=')[1].split('&')[0]
25
- print(full_url)
26
 
27
  # Lọc theo ngày tháng (nếu ngày tháng được cung cấp trong kết quả)
28
  date_elements = soup.find_all('span', class_='f')
 
15
  soup = BeautifulSoup(response.content)
16
  # Tìm tất cả các liên kết trong kết quả tìm kiếm
17
  results = soup.find_all('a')
18
+ mLink=""
19
  # Lọc và hiển thị các liên kết
20
+ for link in soup.find_all("a",href=re.compile("(?<=/url\?q=)(htt.*://.*)")):
21
+ print (re.split(":(?=http)",link["href"].replace("/url?q=","")))
22
+ mLink+=str(re.split(":(?=http)",link["href"].replace("/url?q=","").replace("'","")))
 
 
 
23
 
24
  # Lọc theo ngày tháng (nếu ngày tháng được cung cấp trong kết quả)
25
  date_elements = soup.find_all('span', class_='f')