diff --git a/README.md b/README.md index ddb1b646..1377bd70 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ https://github.com/dotnetcore/DotnetSpider/wiki [View complete Codes](https://github.com/zlzforever/DotnetSpider/blob/master/src/DotnetSpider.Sample/samples/EntitySpider.cs) ````csharp +[DisplayName("博客园爬虫")] public class EntitySpider( IOptions options, DependenceServices services, @@ -92,21 +93,6 @@ public class EntitySpider( await builder.Build().RunAsync(); } - public static async Task RunMySqlQueueAsync() - { - var builder = Builder.CreateDefaultBuilder(options => - { - options.Speed = 1; - }); - builder.UseSerilog(); - builder.IgnoreServerCertificateError(); - builder.UseMySqlQueueBfsScheduler((context, options) => - { - options.ConnectionString = context.Configuration["SchedulerConnectionString"]; - }); - await builder.Build().RunAsync(); - } - protected override async Task InitializeAsync(CancellationToken stoppingToken = default) { AddDataFlow>(); @@ -116,11 +102,6 @@ public class EntitySpider( "https://news.cnblogs.com/n/page/1", new Dictionary { { "网站", "博客园" } })); } - protected override SpiderId GenerateSpiderId() - { - return new(ObjectId.CreateId().ToString(), "博客园"); - } - [Schema("cnblogs", "news")] [EntitySelector(Expression = ".//div[@class='news_block']", Type = SelectorType.XPath)] [GlobalValueSelector(Expression = ".//a[@class='current']", Name = "类别", Type = SelectorType.XPath)] @@ -170,7 +151,6 @@ public class EntitySpider( } } - ```` #### Distributed spider