Skip to content

Commit

Permalink
Merge pull request #13 from BlakeStevenson/20211227-fixes_quotes_in_p…
Browse files Browse the repository at this point in the history
…lacenames

Fixes quotes in placenames
  • Loading branch information
heyitsbryanm authored Dec 28, 2021
2 parents 6fb6326 + 0a46d8f commit d59e024
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,13 @@ module.exports = async function getPopularTimes(placeId, functionOptions) {
console.error(`Did not find a place name using place_id: ${place_id}`)
return {}
} else {
if(placeName.indexOf(`"`) > -1) {
placeName = placeName.replace(/\"/g,'\\"')
}
days = body.window.document.querySelectorAll(`div[aria-label="Popular times at ${placeName}"] > div:last-of-type > div`);
if(!!days) {

}
}

// loop through the days
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "populartimes.js",
"version": "0.4.0",
"version": "0.4.1",
"description": "Get the popular times of a place by scraping Google Maps.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit d59e024

Please sign in to comment.