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
+6
-4
@@ -46,10 +46,12 @@ async function getDetailsFromEventLink(url) {
|
||||
let date = root
|
||||
.querySelector(".c-hero__headline-suffix")
|
||||
.getAttribute("data-timestamp");
|
||||
let location = root
|
||||
.querySelector(".field--name-venue")
|
||||
.innerText.replaceAll("\n", "")
|
||||
.replaceAll(" ", " ");
|
||||
|
||||
let location =
|
||||
root
|
||||
.querySelector(".field--name-venue")
|
||||
?.innerText.replaceAll("\n", "")
|
||||
.replaceAll(" ", " ") || "";
|
||||
let fightCard = [];
|
||||
let mainCard = root.querySelectorAll("#main-card .l-listing__item");
|
||||
let prelims = [];
|
||||
|
||||
Reference in new issue
Block a user