summaryrefslogtreecommitdiff
path: root/src/scraper/scrape.js
diff options
context:
space:
mode:
authoro5pxels <o5pxels@gmail.com>2021-04-09 21:58:01 -0500
committero5pxels <o5pxels@gmail.com>2021-04-09 21:58:01 -0500
commit41909f9189810df0d005b7c8ecac419d0118037f (patch)
treef0d0215ea9d53167ab84f543fbf3b97bbe927c7e /src/scraper/scrape.js
parentea11e81202faabb4083f3580c01ee2572713f232 (diff)
downloadStreamFinder-41909f9189810df0d005b7c8ecac419d0118037f.tar.xz
StreamFinder-41909f9189810df0d005b7c8ecac419d0118037f.zip
Add MongoDB dependency, create basic file layout
Diffstat (limited to 'src/scraper/scrape.js')
-rw-r--r--src/scraper/scrape.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/scraper/scrape.js b/src/scraper/scrape.js
index 2002130..131ae40 100644
--- a/src/scraper/scrape.js
+++ b/src/scraper/scrape.js
@@ -1,8 +1,14 @@
const puppeteer = require('puppeteer');
+const mongodb = require('mongodb')
-async function performSearch(query) {
+// Specifically for scraping
+// Stores in database once finished scraping
+// query is the search string (title of movie or show) and the type (music, show, movie)
+// will be used
+
+async function performSearch(query, type) {
const browser = await puppeteer.launch({
- headless: false
+ headless: true
});
const pages = await browser.pages();
const page = pages[0];
@@ -20,6 +26,8 @@ async function performSearch(query) {
}
console.log(streamingPlatforms);
console.log(streamingPrices);
+ // do the database storage
+ await browser.close();
}
-// performSearch("sorry to bother you") \ No newline at end of file
+// performSearch('spongebob', 'tv'); \ No newline at end of file