arlandfran / anime-corner-rankings-old

0 stars 0 forks source link

Fix scraper.js #36

Closed arlandfran closed 3 years ago

arlandfran commented 3 years ago
Error fetching page:  TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received undefined
    at validateString (internal/validators.js:124:11)
    at Url.parse (url.js:170:3)
    at Object.urlParse [as parse] (url.js:157:13)
    at dispatchHttpRequest (C:\Users\artor\Documents\ms2\anime-corner-rankings\node_modules\axios\lib\adapters\http.js:91:22)
    at new Promise (<anonymous>)
    at httpAdapter (C:\Users\artor\Documents\ms2\anime-corner-rankings\node_modules\axios\lib\adapters\http.js:46:10)
    at dispatchRequest (C:\Users\artor\Documents\ms2\anime-corner-rankings\node_modules\axios\lib\core\dispatchRequest.js:52:10)
    at processTicksAndRejections (internal/process/task_queues.js:95:5) {
  code: 'ERR_INVALID_ARG_TYPE'

Caused by website restructuring - fixed by updating href path

arlandfran commented 3 years ago

On fixing invalid url error, now met with:

Error fetching page:  Error: Value for argument "collectionPath" is not a valid resource path. Path must be a non-empty string.
    at Object.validateResourcePath (C:\Users\artor\Documents\ms2\anime-corner-rankings\node_modules\@google-cloud\firestore\build\src\path.js:414:15)
    at Firestore.collection (C:\Users\artor\Documents\ms2\anime-corner-rankings\node_modules\@google-cloud\firestore\build\src\index.js:582:16)
    at C:\Users\artor\Documents\ms2\anime-corner-rankings\scripts\scraper.js:65:12
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

Caused by post title node reference being changed, fixed by updating post title path