| | |
| | | using System.Net.Http; |
| | | using System.Net.Http.Headers; |
| | | using System.Text; |
| | | using System.Text.RegularExpressions; |
| | | using System.Threading; |
| | | using zhengcaioa.Models; |
| | | namespace Crawler.sichuan |
| | |
| | | list11 = lists.ToList(); |
| | | } |
| | | |
| | | string[] bbb = null; |
| | | var scriptElements = document.QuerySelectorAll("script"); |
| | | foreach (var scriptElement in scriptElements) |
| | | { |
| | | var scriptText = scriptElement.TextContent; |
| | | |
| | | if (scriptText.Contains("var ohtmlurls")) // 检查文本中是否包含特定变量 |
| | | { |
| | | |
| | | int startIndex = scriptText.IndexOf('"') + 1; |
| | | int endIndex = scriptText.IndexOf('"', startIndex); |
| | | if (startIndex > 0 && endIndex > startIndex) |
| | | { |
| | | var aaaa = scriptText.Substring(startIndex, endIndex - startIndex); |
| | | if (!string.IsNullOrEmpty(aaaa)) |
| | | { |
| | | bbb = aaaa.Split(','); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | int ccc = 0; |
| | | |
| | | foreach (var sichuanjieshoudtl1 in lists) |
| | | { |
| | |
| | | try |
| | | { |
| | | sichuanjieshoudtl aaaaaaaa = new sichuanjieshoudtl(); |
| | | aaaaaaaa.pageurl = sichuanjieshoudtl1.QuerySelector("a").GetAttribute("href"); |
| | | if(bbb!=null && bbb.Length>= ccc && !string.IsNullOrEmpty(bbb[ccc])) |
| | | { |
| | | aaaaaaaa.pageurl = bbb[ccc]; |
| | | ccc = ccc + 1; |
| | | } |
| | | else |
| | | { |
| | | ccc = ccc + 1; |
| | | continue; |
| | | } |
| | | // aaaaaaaa.pageurl = sichuanjieshoudtl1.QuerySelector("a").GetAttribute("href"); |
| | | |
| | | logg.WriteLog(aaaaaaaa.pageurl, "中国政采网四川省"); |
| | | aaaaaaaa.title = sichuanjieshoudtl1.QuerySelector("a").TextContent.Replace("\n", "").Trim(); |
| | |
| | | { |
| | | list11 = lists.ToList(); |
| | | } |
| | | |
| | | string[] bbb = null; |
| | | var scriptElements = document.QuerySelectorAll("script"); |
| | | foreach (var scriptElement in scriptElements) |
| | | { |
| | | var scriptText = scriptElement.TextContent; |
| | | |
| | | if (scriptText.Contains("var ohtmlurls")) // 检查文本中是否包含特定变量 |
| | | { |
| | | |
| | | int startIndex = scriptText.IndexOf('"') + 1; |
| | | int endIndex = scriptText.IndexOf('"', startIndex); |
| | | if (startIndex > 0 && endIndex > startIndex) |
| | | { |
| | | var aaaa = scriptText.Substring(startIndex, endIndex - startIndex); |
| | | if (!string.IsNullOrEmpty(aaaa)) |
| | | { |
| | | bbb = aaaa.Split(','); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | int ccc = 0; |
| | | |
| | | foreach (var sichuanjieshoudtl1 in lists) |
| | | { |
| | | Thread.CurrentThread.Join(1000 * 10);//阻止设定时间 |
| | | try |
| | | { |
| | | sichuanjieshoudtl aaaaaaaa = new sichuanjieshoudtl(); |
| | | aaaaaaaa.pageurl = sichuanjieshoudtl1.QuerySelector("a").GetAttribute("href"); |
| | | if (bbb != null && bbb.Length >= ccc && !string.IsNullOrEmpty(bbb[ccc])) |
| | | { |
| | | aaaaaaaa.pageurl = bbb[ccc]; |
| | | ccc = ccc + 1; |
| | | } |
| | | else |
| | | { |
| | | ccc = ccc + 1; |
| | | continue; |
| | | } |
| | | // aaaaaaaa.pageurl = sichuanjieshoudtl1.QuerySelector("a").GetAttribute("href"); |
| | | |
| | | logg.WriteLog(aaaaaaaa.pageurl, "中国政采网四川省"); |
| | | aaaaaaaa.title = sichuanjieshoudtl1.QuerySelector("a").TextContent.Replace("\n", "").Trim(); |
| | |
| | | list11 = lists.ToList(); |
| | | } |
| | | |
| | | string[] bbb = null; |
| | | var scriptElements = document.QuerySelectorAll("script"); |
| | | foreach (var scriptElement in scriptElements) |
| | | { |
| | | var scriptText = scriptElement.TextContent; |
| | | |
| | | if (scriptText.Contains("var ohtmlurls")) // 检查文本中是否包含特定变量 |
| | | { |
| | | |
| | | int startIndex = scriptText.IndexOf('"') + 1; |
| | | int endIndex = scriptText.IndexOf('"', startIndex); |
| | | if (startIndex > 0 && endIndex > startIndex) |
| | | { |
| | | var aaaa = scriptText.Substring(startIndex, endIndex - startIndex); |
| | | if (!string.IsNullOrEmpty(aaaa)) |
| | | { |
| | | bbb = aaaa.Split(','); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | int ccc = 0; |
| | | |
| | | foreach (var sichuanjieshoudtl1 in lists) |
| | | { |
| | | Thread.CurrentThread.Join(1000 * 10);//阻止设定时间 |
| | | try |
| | | { |
| | | sichuanjieshoudtl aaaaaaaa = new sichuanjieshoudtl(); |
| | | aaaaaaaa.pageurl = sichuanjieshoudtl1.QuerySelector("a").GetAttribute("href"); |
| | | if (bbb != null && bbb.Length >= ccc && !string.IsNullOrEmpty(bbb[ccc])) |
| | | { |
| | | aaaaaaaa.pageurl = bbb[ccc]; |
| | | ccc = ccc + 1; |
| | | } |
| | | else |
| | | { |
| | | ccc = ccc + 1; |
| | | continue; |
| | | } |
| | | // aaaaaaaa.pageurl = sichuanjieshoudtl1.QuerySelector("a").GetAttribute("href"); |
| | | |
| | | logg.WriteLog(aaaaaaaa.pageurl, "中国政采网四川省"); |
| | | aaaaaaaa.title = sichuanjieshoudtl1.QuerySelector("a").TextContent.Replace("\n", "").Trim(); |
| | |
| | | list11 = lists.ToList(); |
| | | } |
| | | |
| | | string[] bbb = null; |
| | | var scriptElements = document.QuerySelectorAll("script"); |
| | | foreach (var scriptElement in scriptElements) |
| | | { |
| | | var scriptText = scriptElement.TextContent; |
| | | |
| | | if (scriptText.Contains("var ohtmlurls")) // 检查文本中是否包含特定变量 |
| | | { |
| | | |
| | | int startIndex = scriptText.IndexOf('"') + 1; |
| | | int endIndex = scriptText.IndexOf('"', startIndex); |
| | | if (startIndex > 0 && endIndex > startIndex) |
| | | { |
| | | var aaaa = scriptText.Substring(startIndex, endIndex - startIndex); |
| | | if (!string.IsNullOrEmpty(aaaa)) |
| | | { |
| | | bbb = aaaa.Split(','); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | int ccc = 0; |
| | | |
| | | foreach (var sichuanjieshoudtl1 in lists) |
| | | { |
| | | Thread.CurrentThread.Join(1000 * 10);//阻止设定时间 |
| | | try |
| | | { |
| | | sichuanjieshoudtl aaaaaaaa = new sichuanjieshoudtl(); |
| | | aaaaaaaa.pageurl = sichuanjieshoudtl1.QuerySelector("a").GetAttribute("href"); |
| | | if (bbb != null && bbb.Length >= ccc && !string.IsNullOrEmpty(bbb[ccc])) |
| | | { |
| | | aaaaaaaa.pageurl = bbb[ccc]; |
| | | ccc = ccc + 1; |
| | | } |
| | | else |
| | | { |
| | | ccc = ccc + 1; |
| | | continue; |
| | | } |
| | | // aaaaaaaa.pageurl = sichuanjieshoudtl1.QuerySelector("a").GetAttribute("href"); |
| | | |
| | | logg.WriteLog(aaaaaaaa.pageurl, "中国政采网四川省"); |
| | | aaaaaaaa.title = sichuanjieshoudtl1.QuerySelector("a").TextContent.Replace("\n", "").Trim(); |
| | |
| | | list11 = lists.ToList(); |
| | | } |
| | | |
| | | |
| | | string[] bbb = null; |
| | | var scriptElements = document.QuerySelectorAll("script"); |
| | | foreach (var scriptElement in scriptElements) |
| | | { |
| | | var scriptText = scriptElement.TextContent; |
| | | |
| | | if (scriptText.Contains("var ohtmlurls")) // 检查文本中是否包含特定变量 |
| | | { |
| | | |
| | | int startIndex = scriptText.IndexOf('"') + 1; |
| | | int endIndex = scriptText.IndexOf('"', startIndex); |
| | | if (startIndex > 0 && endIndex > startIndex) |
| | | { |
| | | var aaaa = scriptText.Substring(startIndex, endIndex - startIndex); |
| | | if (!string.IsNullOrEmpty(aaaa)) |
| | | { |
| | | bbb = aaaa.Split(','); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | int ccc = 0; |
| | | |
| | | foreach (var sichuanjieshoudtl1 in lists) |
| | | { |
| | | Thread.CurrentThread.Join(1000 * 10);//阻止设定时间 |
| | | try |
| | | { |
| | | sichuanjieshoudtl aaaaaaaa = new sichuanjieshoudtl(); |
| | | aaaaaaaa.pageurl = sichuanjieshoudtl1.QuerySelector("a").GetAttribute("href"); |
| | | if (bbb != null && bbb.Length >= ccc && !string.IsNullOrEmpty(bbb[ccc])) |
| | | { |
| | | aaaaaaaa.pageurl = bbb[ccc]; |
| | | ccc = ccc + 1; |
| | | } |
| | | else |
| | | { |
| | | ccc = ccc + 1; |
| | | continue; |
| | | } |
| | | // aaaaaaaa.pageurl = sichuanjieshoudtl1.QuerySelector("a").GetAttribute("href"); |
| | | |
| | | logg.WriteLog(aaaaaaaa.pageurl, "中国政采网四川省"); |
| | | aaaaaaaa.title = sichuanjieshoudtl1.QuerySelector("a").TextContent.Replace("\n", "").Trim(); |