From 4ec8c0f6eddbce708c056ded4b2d7c61647f3289 Mon Sep 17 00:00:00 2001 From: Lewis Zou Date: Wed, 29 May 2024 11:26:08 +0800 Subject: [PATCH] Update README.md --- README.md | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) 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