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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -13,9 +13,12 @@ def run_lora(prompt,site,start,end):
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
- page = requests.get(murl)
 
 
 
17
  print("https://www.google.com/search?q=site:" +site + " " +prompt + "&tbs=cdr%3A1%2Ccd_min%3A"+start+"%2Ccd_max%3A" + end)
18
- soup = BeautifulSoup(response.text, 'html.parser')
19
  print(soup)
20
  search_results = []
21
  for g in soup.find_all('div', class_='MjjYud'):
 
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'
18
+ }
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'):