Commit Graph
12 Commits
Author SHA1 Message Date
Elendil 46086ffaf9 ConfigProvider update
Create a ConifgProviderFactory so thay we can get ConfigProvider from a single point
Also enhenced the logic of refresh config, right now when zookeeper watcher dected the config is changed
NScrapy will update its context, and during that time, NScrapy will lock the access to the Connection of Redis
2018-07-04 23:31:44 +08:00
Elendil 5a0ff77c8c ZKConfigProvider v0.1 2018-07-04 00:11:40 +08:00
Elendil 66275a5598 POC of Zookeeper .net Client
also intergrate with ZookeeperConfigProvider
to be honest Zookeeper api is so hard to understand, why it is designed in such way?
2018-06-28 00:24:12 +08:00
Elendil 7c15c702c6 ItemPipeLine first version
Enable ItemPipeline function by setting the below appsetting.json setting
"Pipelines": [
      { "Pipeline": "NScrapy.Infra.Pipeline.MockPipeline" }
    ],
there is also a mock test case for ItemPipeline
2018-05-17 00:11:59 +08:00
Elendil 00f90d9492 Change the response from Topic to Queue so that multiple Spider won't process the same response duplicate
Add lock to response pick logic
2018-05-10 02:04:54 +08:00
Elendil 2ed341c009 Add Distributed Support for Spider
Still need some investigate against that if the spider will crawl the same page while there are multiple spider running
2018-05-09 01:30:43 +08:00
Elendil a47b109a2e Distributed Downloader Version 0.1
A big step for NScrayp, it can now utilize multiple Downloaders
Downloaders are now distributed to different process/machine, the connection
between Downloader and Spider is based on Scheduler, the scheduler distribute
Downloader task to different Downloader through Redis MQ
Details can be configed in appsetting.json
NScrapy still support single process mode, as long as we specify the run mode to InMemory
2018-05-06 22:57:39 +08:00
Elendil d299ff60f3 Bug Fix and Log Function
Added log4net at the bottom of the project, in NScrapyContext
Enhenced the Response.CssSelector so that we can select element based on a set of selector
This is very userful when the web page have tiny different between each page
2018-04-26 01:44:14 +08:00
Elendil 27f63d5040 Bug fix and add Test case for DownloaderMiddleware
Bug fix of DownloaderMiddleware loading
Add Test case of HttpUserAgentPoolMiddleware
2018-04-23 22:41:50 +08:00
Elendil 05368bee59 Optimized the Structure of the Entire Project
Involve HtmlAgilityPack and HtmlAgilityPack.CssSelector.NetCore in Infra
To help Getting element through CSS Selector
2018-04-18 22:12:37 +08:00
Elendil adc1044009 Add DownloaderMiddleware process logic and added a default DownloaderMiddleware
HttpHeaderMiddleware as a Default DownloaderMiddleware will set HttpRequest Header
based on the config in appsetting.json (AppSettings:HttpHeader section)
If specified node is not set in config file, Middleware will use its default value to fullfill the request header
2018-04-13 01:12:15 +08:00
Elendil 18c4dca3ab Created base structure of NScrapy Shell, Engine, Scheduler, Downloader
Engine:
1.Configurable in appsetting.json to choice a real engine or a mock engine for test
2.Listen to Item queue to handle the request sent by Scheduler
Shell:
1.Init Context for NScrapy to run
	1).Read Config
2.Get Spider through Spider Factory
Scheduler:
1.Send request to Queue which the engine is listening
Downloader
1.Init DownloaderPool
2.Asyncly Process all the incoming request by picking a Downloader from DownloaderPool
*Test Case update
EngineTest:Test if the message can be sent to MockEngine through Shell->Spider->Scheduler->Engine
ConstructDownloader:Test if DownloaderPool can work, if the Downloader can actually get response from Website
2018-04-12 00:27:39 +08:00