diff --git a/README.md b/README.md index 4518466..3c4fc3b 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ func main() { geziyor.NewGeziyor(&geziyor.Options{ StartURLs: []string{"http://quotes.toscrape.com/"}, ParseFunc: quotesParse, - Exporters: []geziyor.Exporter{exporter.JSON{}}, + Exporters: []geziyor.Exporter{export.JSON{}}, }).Start() } @@ -111,12 +111,15 @@ You can add [Extractor](https://godoc.org/github.com/geziyor/geziyor/extractor) geziyor.NewGeziyor(&geziyor.Options{ StartURLs: []string{"https://www.theverge.com/2019/6/27/18760384/facebook-libra-currency-cryptocurrency-money-transfer-bank-problems-india-china"}, Extractors: []geziyor.Extractor{ - &extractor.Text{Name: "title", Selector: ".c-page-title"}, - &extractor.Text{Name: "byline", Selector: ".c-byline__item:nth-child(1) > a"}, - &extractor.Text{Name: "summary", Selector: ".c-entry-summary"}, - &extractor.Text{Name: "content", Selector: ".c-entry-content"}, + &extract.HTML{Name: "entry_html", Selector: ".c-entry-hero__content"}, + &extract.Text{Name: "title", Selector: ".c-page-title"}, + &extract.OuterHTML{Name: "title_html", Selector: ".c-page-title"}, + &extract.Text{Name: "author", Selector: ".c-byline__item:nth-child(1) > a"}, + &extract.Attr{Name: "author_url", Selector: ".c-byline__item:nth-child(1) > a", Attr: "href"}, + &extract.Text{Name: "summary", Selector: ".c-entry-summary"}, + &extract.Text{Name: "content", Selector: ".c-entry-content"}, }, - Exporters: []geziyor.Exporter{&exporter.JSON{}}, + Exporters: []geziyor.Exporter{&export.JSON{}}, }).Start() ``` @@ -154,7 +157,7 @@ geziyor.NewGeziyor(&geziyor.Options{ } }) }, - Exporters: []geziyor.Exporter{&exporter.JSON{}}, + Exporters: []geziyor.Exporter{&export.JSON{}}, }).Start() ```