/// <summary> /// urlとHtmlを入力として、結果を返す。 /// </summary> /// <param name="url"></param> /// <param name="EnableGetSubUrlLink"></param> /// <param name="takeNum"></param> /// <param name="maxPage"></param> /// <returns></returns> public static ResultData GetDataList(string url, bool EnableGetSubUrlLink, int takeNum, int maxPage) { ReportStock rs = new ReportStock(); WebClient wc = new WebClient() { AddUserAgent = true }; rs.Add(wc); var rawler = wc.Page(url).AddRange( new RawlerAutoListDataWrite() { TakeNum = takeNum, EnableGetSubUrlLink = EnableGetSubUrlLink }, new RawlerAutoNextLink() { MaxCount = maxPage }, new RawlerAutoTable()).GetRoot(); rawler.Run(); return new ResultData() { Data = rawler.GetDescendantRawler().OfType<Data>().DataSort().ToArray(), Reports = rs.ReportList }; }
public static Rawler.Tool.RawlerBase GetDataListRawlerBase(string url, bool EnableGetSubUrlLink, int takeNum, int maxPage) { ReportStock rs = new ReportStock(); WebClient wc = new WebClient() { AddUserAgent = true }; rs.Add(wc); return wc.Page(url).Add(new RawlerAutoListDataWrite() { TakeNum = takeNum, EnableGetSubUrlLink = EnableGetSubUrlLink }).Add(new RawlerAutoNextLink() { MaxCount = maxPage }).GetRoot(); }