Skip to content

Commit

Permalink
Use urlparse
Browse files Browse the repository at this point in the history
  • Loading branch information
minottic committed Jul 5, 2024
1 parent 278af83 commit 33e277e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/make_relative_to.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from os import environ, path as ospath
from urllib.parse import urljoin, urlsplit
from urllib.parse import urlparse, urlsplit
from bs4 import BeautifulSoup
from pathlib import Path
import logging
Expand All @@ -22,8 +22,8 @@ def on_page_content(html, page, config, files):
log.warning(f'env: {environ["BASE_URL"]}')
log.warning(f'page.url: {page.url}')
log.warning(f'href: {element["href"]}')
log.warning(urljoin(f"{environ['BASE_URL']}/", f"{page.url}/{element['href']}"))
element['href'] = urljoin(f"{environ['BASE_URL']}/", f"{page.url}/{element['href']}")
log.warning(f"{environ['BASE_URL']}/", f"{page.url}/{element['href']}")
element['href'] = str(urlparse(f"{environ['BASE_URL']}/{page.url}/{element['href']}"))
return soup.prettify()


Expand Down

0 comments on commit 33e277e

Please sign in to comment.