mirror of
https://github.com/clarencechaan/ufc-cal.git
synced 2026-10-19 00:38:30 -07:00
Fix bug where scraping breaks when no location is announced
This commit is contained in:
1 parent
0b89eadd55
commit
5c503646de
1 file changed
+5
-3
@@ -46,10 +46,12 @@ async function getDetailsFromEventLink(url) {
|
|||||||
let date = root
|
let date = root
|
||||||
.querySelector(".c-hero__headline-suffix")
|
.querySelector(".c-hero__headline-suffix")
|
||||||
.getAttribute("data-timestamp");
|
.getAttribute("data-timestamp");
|
||||||
let location = root
|
|
||||||
|
let location =
|
||||||
|
root
|
||||||
.querySelector(".field--name-venue")
|
.querySelector(".field--name-venue")
|
||||||
.innerText.replaceAll("\n", "")
|
?.innerText.replaceAll("\n", "")
|
||||||
.replaceAll(" ", " ");
|
.replaceAll(" ", " ") || "";
|
||||||
let fightCard = [];
|
let fightCard = [];
|
||||||
let mainCard = root.querySelectorAll("#main-card .l-listing__item");
|
let mainCard = root.querySelectorAll("#main-card .l-listing__item");
|
||||||
let prelims = [];
|
let prelims = [];
|
||||||
|
|||||||
Reference in new issue
Block a user