Ramesh-vani commited on
Commit
1f18bc9
·
verified ·
1 Parent(s): 403f8d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -498,14 +498,14 @@ async def handle_user_input(websocket,key, process, connected,process_ids):
498
  # Parse HTML content
499
  soup = BeautifulSoup(response.text, "html.parser")
500
  # Get base URL
501
- base_url = urlparse(url)
502
- base_host = base_url.netloc.rstrip("/")
503
  # Function to join relative URLs with base URL
504
  def join_url_with_base(url):
505
  if url.startswith('/'):
506
- return urljoin(url, base_host)
507
  else:
508
- return urljoin(url, base_url.geturl())
509
 
510
  # Find and modify CSS links
511
  for link in soup.find_all("link", rel="stylesheet", href=True):
@@ -888,14 +888,14 @@ async def exe(websocket,connected,key,process_ids):
888
  # Parse HTML content
889
  soup = BeautifulSoup(response.text, "html.parser")
890
  # Get base URL
891
- base_url = urlparse(url)
892
- base_host = base_url.netloc.rstrip("/")
893
  # Function to join relative URLs with base URL
894
  def join_url_with_base(url):
895
  if url.startswith('/'):
896
- return urljoin(url, base_host)
897
  else:
898
- return urljoin(url, base_url.geturl())
899
 
900
  # Find and modify CSS links
901
  for link in soup.find_all("link", rel="stylesheet", href=True):
 
498
  # Parse HTML content
499
  soup = BeautifulSoup(response.text, "html.parser")
500
  # Get base URL
501
+ base_url = url
502
+ # base_host = base_url.netloc.rstrip("/")
503
  # Function to join relative URLs with base URL
504
  def join_url_with_base(url):
505
  if url.startswith('/'):
506
+ return base_url+url
507
  else:
508
+ return url
509
 
510
  # Find and modify CSS links
511
  for link in soup.find_all("link", rel="stylesheet", href=True):
 
888
  # Parse HTML content
889
  soup = BeautifulSoup(response.text, "html.parser")
890
  # Get base URL
891
+ base_url = url
892
+ # base_host = base_url.netloc.rstrip("/")
893
  # Function to join relative URLs with base URL
894
  def join_url_with_base(url):
895
  if url.startswith('/'):
896
+ return base_url+url
897
  else:
898
+ return url
899
 
900
  # Find and modify CSS links
901
  for link in soup.find_all("link", rel="stylesheet", href=True):