summaryrefslogtreecommitdiff
path: root/crocoite/behavior.py
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2018-03-05 19:06:55 +0100
committerLars-Dominik Braun <lars@6xq.net>2018-03-05 19:06:55 +0100
commit95ee40fa8cdca9cff0aba033a4352fc0621a9583 (patch)
tree0d554d825e9b70d5829e515fcca7c5c259aeadd6 /crocoite/behavior.py
parentd571bed665cee1af6b2212c04791a7a11f18cf7d (diff)
downloadcrocoite-95ee40fa8cdca9cff0aba033a4352fc0621a9583.tar.gz
crocoite-95ee40fa8cdca9cff0aba033a4352fc0621a9583.tar.bz2
crocoite-95ee40fa8cdca9cff0aba033a4352fc0621a9583.zip
Add generic click behavior script
Configureable. Clicks elements matching one (or more) CSS selectors once or multiple times. Currently supported: Facebook, Twitter, Disqus (embedded iframe)
Diffstat (limited to 'crocoite/behavior.py')
-rw-r--r--crocoite/behavior.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/crocoite/behavior.py b/crocoite/behavior.py
index e4ec93b..26841aa 100644
--- a/crocoite/behavior.py
+++ b/crocoite/behavior.py
@@ -222,17 +222,18 @@ class Screenshot (Behavior):
'X-Chrome-Viewport': viewport})
writer.write_record (record)
-### Site-specific scripts ###
+class Click (JsOnload):
+ """ Generic link clicking """
+
+ name = 'click'
+ scriptPath = 'click.js'
-class Twitter (HostnameFilter, JsOnload):
- name = 'twitter'
- scriptPath = 'per-site/twitter.js'
- hostname = ['com', 'twitter']
+### Site-specific scripts ###
# available behavior scripts. Order matters, move those modifying the page
# towards the end of available
-generic = [Scroll, EmulateScreenMetrics]
-perSite = [Twitter]
+generic = [Scroll, EmulateScreenMetrics, Click]
+perSite = []
available = generic + perSite + [Screenshot, DomSnapshot]
availableNames = set (map (lambda x: x.name, available))