playstation: remove anchor link from game url
This commit is contained in:
parent
f0cf3436f5
commit
6a5cbdb344
1 changed files with 6 additions and 5 deletions
|
|
@ -206,9 +206,10 @@ async function redeemFreeGames() {
|
||||||
.locator(".cta__primary")
|
.locator(".cta__primary")
|
||||||
.getAttribute("href");
|
.getAttribute("href");
|
||||||
// standardize URLs
|
// standardize URLs
|
||||||
return urlSlug.charAt(0) === "/"
|
return (urlSlug.charAt(0) === "/"
|
||||||
? `https://www.playstation.com${urlSlug}`
|
? `https://www.playstation.com${urlSlug}` // base url may not be present, add it back
|
||||||
: urlSlug;
|
: urlSlug)
|
||||||
|
.split('#').shift(); // url may have anchor tag, remove it
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
console.log("Free games:", monthlyGamesPageLinks);
|
console.log("Free games:", monthlyGamesPageLinks);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue