Skip to content

Commit

Permalink
functionallity for SSRs
Browse files Browse the repository at this point in the history
  • Loading branch information
LTurret committed Jul 7, 2023
1 parent 1b253a4 commit 7ccba8e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ def fetch(url) -> list[tuple]:
page = bs(request.content, "html.parser")
queue: list[tuple] = []

for element in page.find_all("img", {"class": "d-block w-100"}):
element: str = str(element)

begin: int = search("cards/", url).end()
folder = f"{url[begin:]}"

begin : int = search("card_bg/", element).end()
end: int = search(".png", element).start()
filename: str = element[begin:end]

begin = search('src="', element).end()
end = search('"/>', element).start()
queue.append((folder, filename, element[begin:end]))

for element in page.find_all("div", {"class": "card-img-b"}):
element: str = str(element)

Expand Down

0 comments on commit 7ccba8e

Please sign in to comment.