L'url des images est absolue
This commit is contained in:
parent
f48f202e18
commit
9d84f4f630
@ -1,6 +1,7 @@
|
|||||||
from ..generic_extractors import *
|
from ..generic_extractors import *
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
# A class dedicated to get events from Raymond Bar
|
# A class dedicated to get events from Raymond Bar
|
||||||
# URL: https://www.raymondbar.net/
|
# URL: https://www.raymondbar.net/
|
||||||
@ -63,6 +64,8 @@ class CExtractor(TwoStepsExtractorNoPause):
|
|||||||
published=False,
|
published=False,
|
||||||
):
|
):
|
||||||
|
|
||||||
|
root_address_human = "https://" + urlparse(self.url_human).netloc + "/"
|
||||||
|
|
||||||
soup = BeautifulSoup(event_content, "xml")
|
soup = BeautifulSoup(event_content, "xml")
|
||||||
|
|
||||||
|
|
||||||
@ -71,7 +74,7 @@ class CExtractor(TwoStepsExtractorNoPause):
|
|||||||
|
|
||||||
soup = BeautifulSoup(content, "html.parser")
|
soup = BeautifulSoup(content, "html.parser")
|
||||||
|
|
||||||
image = soup.select_one(".image img")["src"]
|
image = root_address_human + soup.select_one(".image img")["src"]
|
||||||
description = soup.select_one(".rightcolumn .content").text
|
description = soup.select_one(".rightcolumn .content").text
|
||||||
location = soup.select_one(".infos .location").text
|
location = soup.select_one(".infos .location").text
|
||||||
public = soup.select_one(".infos .public").text
|
public = soup.select_one(".infos .public").text
|
||||||
|
Loading…
x
Reference in New Issue
Block a user