import rss import webdriver import osproc import options import os import strutils #Feednim var test = getRSS("https://rss.indeed.com/rss?q=Linux&l=Arkansas&explvl=mid_level") var URL = test.items[5].link #Webdriver #TODO put location of chromedriver into config let chromedriver = startProcess("/usr/bin/chromedriver") sleep 5000 echo "connecting" let driver = newWebDriver("http://localhost:9515") let session = driver.createSession() session.navigate(URL) #HTML Parser var jobTimes: string var salaryGuide: string let jobTitle = session.findElement(".jobsearch-JobInfoHeader-title").get().getText() let employer = session.findElement(".jobsearch-CompanyReview--heading").get().getText() try: jobTimes = session.findElement(".jobsearch-JobDescriptionSection-sectionItem").get().getText() except UnpackDefect: jobTimes = "" try: salaryGuide = session.findelement("#salaryGuide").get().gettext() except UnpackDefect: salaryGuide = "None Listed" if salaryGuide.contains("Not provided by employer"): salaryGuide = "None Listed" let fullDesc = session.findElement("#jobDescriptionText").get().getText() session.close() terminate(chromedriver) #Job Value Scorer #Parsing Salary #Output var output = """ \documentclass{article} \usepackage[margin=0.7in]{geometry} \usepackage{pdfpages} \usepackage{hyperref} \hypersetup{ colorlinks=true, linkcolor=black, filecolor=magenta, urlcolor=blue, } \begin{document} \begin{center} \Huge{$1} \end{center} \hrulefill \large{$2} \hspace{3cm} \large{$3} \hspace{3cm} \large{\href{$4}{URL}} \hspace{3cm} \large{$5} \hrulefill $6 \end{document} """ % [jobTitle, employer, salaryGuide, URL.replace("&","\\&"), jobTimes, fullDesc.replace("#", "\\#").replace("&", "\\&").replace("\"", "\\\"").replace("'","\\'")] writeFile("/tmp/test.tex", output) discard execCmd( "latexmk -pdf -pvc /tmp/test.tex")