adpro commited on
Commit
c8b43dc
·
verified ·
1 Parent(s): cc9d81f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -11,7 +11,7 @@ def run_lora(prompt,site,start,end):
11
 
12
 
13
 
14
- murl = "https://www.google.com/search?q=site:" +site + " " +prompt + "&sca_esv=9a56963d0daaccd0&sca_upv=1&tbs=cdr%3A1%2Ccd_min%3A"+start+"%2Ccd_max%3A" + end
15
  surl = "https://www.google.com/search?q=site:" +site + " " +prompt + "after:"+start+"before:" + end
16
  headers = {
17
  'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
@@ -19,9 +19,9 @@ def run_lora(prompt,site,start,end):
19
  page = requests.get(murl,headers)
20
  print("https://www.google.com/search?q=site:" +site + " " +prompt + "&tbs=cdr%3A1%2Ccd_min%3A"+start+"%2Ccd_max%3A" + end)
21
  soup = BeautifulSoup(page.text, 'html.parser')
22
- print(soup)
23
  search_results = []
24
- for g in soup.find_all('div', class_='MjjYud'):
 
25
  print(g)
26
  title = g.find('h3').text if g.find('h3') else 'No title'
27
  link = g.find('a')['href']
 
11
 
12
 
13
 
14
+ murl = f"https://www.google.com/search?q=site:" +site + "+" +prompt + "&tbs=cdr:1,cd_min:{start},cd_max:{end}"
15
  surl = "https://www.google.com/search?q=site:" +site + " " +prompt + "after:"+start+"before:" + end
16
  headers = {
17
  'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
 
19
  page = requests.get(murl,headers)
20
  print("https://www.google.com/search?q=site:" +site + " " +prompt + "&tbs=cdr%3A1%2Ccd_min%3A"+start+"%2Ccd_max%3A" + end)
21
  soup = BeautifulSoup(page.text, 'html.parser')
 
22
  search_results = []
23
+ #MjjYud
24
+ for g in soup.find_all('div', class_='tF2Cxc'):
25
  print(g)
26
  title = g.find('h3').text if g.find('h3') else 'No title'
27
  link = g.find('a')['href']