added option for generating csv from visible elements only