Skip to content

Commit

Permalink
feat: join base url with href
Browse files Browse the repository at this point in the history
  • Loading branch information
amhsirak committed Nov 23, 2024
1 parent 1e08908 commit fc2e3dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion maxun-core/src/browserSide/scraper.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ function scrapableHeuristics(maxCountPerPage = 50, minArea = 20000, scrolls = 3,

switch (attribute) {
case 'href':
return elem.getAttribute('href');
const relativeHref = elem.getAttribute('href'); // Get the href attribute
return relativeHref ? new URL(relativeHref, window.location.origin).href : null; // Convert to full URL
case 'src':
return elem.getAttribute('src');
case 'innerText':
Expand Down

0 comments on commit fc2e3dc

Please sign in to comment.