KingNish commited on
Commit
7d13f3b
1 Parent(s): 0fe027e

Update chatbot.py

Browse files
Files changed (1) hide show
  1. chatbot.py +1 -1
chatbot.py CHANGED
@@ -270,7 +270,7 @@ def search(term, num_results=2, lang="en", advanced=True, timeout=5, safe="activ
270
  if link:
271
  link = link["href"]
272
  try:
273
- webpage = session.get(link, headers={"User-Agent": get_useragent()})
274
  webpage.raise_for_status()
275
  visible_text = extract_text_from_webpage(webpage.text)
276
  # Truncate text if it's too long
 
270
  if link:
271
  link = link["href"]
272
  try:
273
+ webpage = session.get(link, headers={"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0"})
274
  webpage.raise_for_status()
275
  visible_text = extract_text_from_webpage(webpage.text)
276
  # Truncate text if it's too long