testing #4
@ -1,4 +1,5 @@
|
|||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
def table_parser(soup: BeautifulSoup, output):
|
def table_parser(soup: BeautifulSoup, output):
|
||||||
#Date parser
|
#Date parser
|
||||||
@ -24,8 +25,10 @@ def table_parser(soup: BeautifulSoup, output):
|
|||||||
|
|
||||||
|
|
||||||
def image_parser(soup: BeautifulSoup):
|
def image_parser(soup: BeautifulSoup):
|
||||||
|
image: Any
|
||||||
|
extension = ('png', 'jpg')
|
||||||
main = soup.find("main")
|
main = soup.find("main")
|
||||||
image = main.select('img[src$=".png"]')
|
for ext in extension:
|
||||||
output = image[0]['src']
|
image = main.select(f'img[src$=".{ext}"]')
|
||||||
|
if image:
|
||||||
return output
|
return image[0]['src']
|
||||||
|
2
start.sh
2
start.sh
@ -1,6 +1,6 @@
|
|||||||
docker build -t replace-bot .
|
docker build -t replace-bot .
|
||||||
docker run --net=br0 \
|
docker run --net=br0 \
|
||||||
--name=replacebot \
|
--name=replacebot \
|
||||||
--mount type=bind,source="$(pwd)",target=/app $@ \
|
-v "$(pwd)":/app $@ \
|
||||||
--ip=10.0.0.3 --restart=unless-stopped \
|
--ip=10.0.0.3 --restart=unless-stopped \
|
||||||
replace-bot
|
replace-bot
|
||||||
|
Loading…
Reference in New Issue
Block a user