testing #11

Merged
tema merged 16 commits from testing into master 2023-03-28 10:31:08 +03:00
Showing only changes of commit 7b5af42082 - Show all commits

View File

@ -1,4 +1,5 @@
from bs4 import BeautifulSoup
from typing import Any
def table_parser(soup: BeautifulSoup, output):
#Date parser
@ -24,8 +25,10 @@ def table_parser(soup: BeautifulSoup, output):
def image_parser(soup: BeautifulSoup):
image: Any
extension = ('png', 'jpg')
main = soup.find("main")
image = main.select('img[src$=".png"]')
output = image[0]['src']
return output
for ext in extension:
image = main.select(f'img[src$=".{ext}"]')
if image:
return image[0]['src']