Skip to content

Commit

Permalink
feat: add google.com/maps
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Fernandes committed Jan 10, 2024
1 parent 019944a commit 2f066a7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,21 @@ function getScrapperOptionsByUrl(url: string, title: string) {
}
}

if (url.includes('google.com/maps/search')) {
return {
header: title,
listElementsQuery: '[role="feed"] [jsaction*="mouseover"]',
elementParser: [
{ title: 'Image', query: 'img', type: 'image' },
{ title: 'Name', query: 'a', type: 'get-attribute', attribute: 'aria-label' },
{ title: 'Rating', query: 'span[role="img"]', type: 'get-attribute', attribute: 'aria-label'},
{ title: 'Link', query: 'a', type: 'clean-url' }
]
}
}

//

return null;
}

Expand Down
2 changes: 2 additions & 0 deletions src/utils/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export function hasImage(cell: any) {
return cell.startsWith('http') && (
cell.toLowerCase().includes('/image/')
|| cell.toLowerCase().includes('/images/')
|| cell.toLowerCase().includes('thumbnail')
|| cell.includes('googleusercontent.com/p/')
|| (
cell.includes('.jpg')
|| cell.includes('.jpeg')
Expand Down

0 comments on commit 2f066a7

Please sign in to comment.