Extractor.stop()

This commit is contained in:
2020-01-15 14:18:31 +08:00
parent 2224db1ad1
commit da7ae057f4
3 changed files with 40 additions and 6 deletions

View File

@ -13,10 +13,14 @@ All you need to do is:
## Qucik Start
Extract current page
```js
$('.item', ['a', 'a@href']);
new Extractor().task('.item', ['a', 'a@href']).start();
```
> `$(...args)` is the short form of `new Extractor().task(...args).start();`, which is introduced later.
Extract multiple pages (1-10, interval 1)
```js
@ -54,6 +58,15 @@ function (itemsSelector:string, fieldSelectors:string[], urls:ExtractResult)
Close the target tab, in which current tasks is running.
Or use `job.stop()`:
```js
job = new Extractor().task('.search-list-item', ['a@href'], ["http://sample.com/abc"])
.task('list-item', ["a.title", "p.content"])
.start();
job.stop();
```
## Extract Attributes.
e.g.: link text and target (use 'selector@attribute')