0

Hello this is my first time posting but long time user. I searched for quite a while but couldn't find anything here that would help.

I am trying to scrape information from my works time keeping system. They Use Work Force Optimization. The site is terrible and im trying to make life easier for my employees.

var web = new HtmlWeb();
        web.PreRequest = delegate (HttpWebRequest webRequest)
        {
            webRequest.Timeout = 1200000;
            return true;
        };
        NetworkCredential cred = new NetworkCredential("MyUserName", "MyPassword");
        var proxy = new WebProxy() { UseDefaultCredentials = true };
        var doc = web.Load("https://wfo.company.com/WFO/default/WFM/ScheduleEditor#", "GET", proxy, cred);

        string test = doc.DocumentNode.SelectSingleNode("//*[@id=\"mainContentScheduleEditor\"]/div[3]/ul/li[1]/div[1]/div").InnerText;

The nullException happens when it runs the string test line. Below is the html from the site I pulled from chrome.

<div class="agendaDayHeader">
            <a href="#" class="dateLabel" data-bind="attr: {title: Aspect.WFO.WFM.DataFormat.formatAgendaWeekdayNameShortDate(NominalDate())}, text: Aspect.WFO.WFM.DataFormat.formatAgendaWeekdayNameShortDate(NominalDate())" title="Sunday, 12/6/2015">Sunday, 12/6/2015</a>

I wasn't sure if I should have posted the whole 2000 lines here but this is the element that I wanted to get the inner text of it should simply return the weekday and date of that portion of the schedule.

Thanks for you help in advance I hope provided enough information.

0 Answers0