Write browser behaviors inline in the Groovy profile and docs

This commit is contained in:
Alex Osborne committed 2026-11-13 16:08:42 +09:00
1 parent fb3452a6af
commit db156f3427
2 files changed
+6 -14

No files matched your search

+4 -10
View File
@@ -979,12 +979,10 @@ default profile includes it as a commented-out ``browser`` bean:
.. code-block:: groovy
scrollDownBehavior(ScrollDownBehavior)
extractLinksBehavior(ExtractLinksBehavior)
browser(BrowserProcessor) {
behaviors = [
ref('scrollDownBehavior'),
ref('extractLinksBehavior')
new ScrollDownBehavior(),
new ExtractLinksBehavior()
]
concurrency = 20
executable = 'firefox'
@@ -1036,14 +1034,10 @@ Behaviors run in the order they're listed:
.. code-block:: groovy
scrollDownBehavior(ScrollDownBehavior)
paginationBehavior(PaginationBehavior) {
selector = 'a.next-page'
}
browser(BrowserProcessor) {
behaviors = [
ref('scrollDownBehavior'),
ref('paginationBehavior')
new ScrollDownBehavior(),
new PaginationBehavior(selector: 'a.next-page')
]
}
@@ -291,12 +291,10 @@ http://example.example/example
extractorJs(ExtractorJS)
extractorSwf(ExtractorSWF)
/*
scrollDownBehavior(ScrollDownBehavior)
extractLinksBehavior(ExtractLinksBehavior)
browser(BrowserProcessor) {
behaviors = [
ref('scrollDownBehavior'),
ref('extractLinksBehavior')
new ScrollDownBehavior(),
new ExtractLinksBehavior()
]
concurrency = 20
browsers = [