This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| browser.close(); | |
| return arrayJobResults; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| run().then((value) => { | |
| let data = value.join("\r\n"); | |
| console.log(data); | |
| fs.writeFile("state-farm-jobs.txt", data, function (err) { | |
| console.log(constants.SUCCESS_STMT); | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const transporter = nodemailer.createTransport(smtpTransport({ | |
| service: 'Gmail', | |
| host: 'smtp.gmail.com', | |
| port: 465, | |
| auth: { | |
| user: credentials.email, | |
| pass: credentials.password | |
| } | |
| })); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const stateFarmModule = require("./scrape-state-farm.js"); | |
| const emailModule = require("./send-email.js"); | |
| stateFarmModule(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| run().then((value) => { | |
| let data = value.join("\r\n"); | |
| console.log(data); | |
| fs.writeFile("state-farm-jobs.txt", data, function (err) { | |
| console.log(constants.SUCCESS_STMT); | |
| }); | |
| console.log("scrape-state-farm.js - created txt file") | |
| emailModule(); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const page = await browser.newPage(); | |
| await page.goto("https://statefarm.csod.com/ats/careersite/search.aspx?site=1&c=statefarm"); | |
| await page.click("#ctl00_siteContent_widgetLayout_rptWidgets_ctl03_widgetContainer_ctl00_rptCustomFields_ctl02_customFieldWrapper > button"); | |
| await page.click("body > div > ul > li:nth-child(46) > label > span"); | |
| await page.click("#ctl00_siteContent_widgetLayout_rptWidgets_ctl03_widgetContainer_ctl00_rptCustomFields_ctl00_customFieldWrapper_ctl00_txtValue"); | |
| await page.keyboard.type("technology"); | |
| await page.click("#ctl00_siteContent_widgetLayout_rptWidgets_ctl03_widgetContainer_ctl00_btnSearch"); | |
| await page.waitFor(2000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = { | |
| email: "YOUR_EMAIL", | |
| password: "YOUR_PASSWORD" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function stateFarmModule() { | |
| //previous code here | |
| } | |
| module.exports = stateFarmModule; | |
| function emailModule() { | |
| //previous code here | |
| } | |
| module.exports = emailModule; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MagicNumber { | |
| String pipeDelimitedString = "This|is|an|example|of|Magic|Numbers|123 Parker Road|[email protected]"; | |
| String [] splitString = pipeDelimitedString.split("\\|"); | |
| obj.doSomething(splitString[7]); | |
| obj.doSomething(splitString[8]); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MagicNumber { | |
| String pipeDelimitedString = "This|is|an|example|of|Magic|Numbers|123 Parker Road|[email protected]"; | |
| String [] splitString = pipeDelimitedString.split("\\|"); | |
| obj.doSomething(splitString[Constants.HOME_ADDRESS]); | |
| obj.doSomething(splitString[Constants.EMAIL_ADDRESS]); | |
| } | |
| class Constants { |