Skip to content

Instantly share code, notes, and snippets.

@DIVISHAD
DIVISHAD / tickertape-report-exporter.js
Last active August 19, 2024 07:19 — forked from anupkrbid/tickertape-report-exporter.js
This is a script to export the tickertape screener results in a CSV format.
const scrapeData = () => {
const sections = document.querySelectorAll("#screener-table > table");
const headingElements = sections[0].querySelectorAll("th");
const scrapedData = Array.from(headingElements).map(elm => {
const selector = elm.getAttribute("id") === "name" ? "data-col" : elm.getAttribute("id") + "-col";
const rowElements = sections[0].querySelectorAll('tbody')[0].querySelectorAll("." + selector + " .ellipsis .desktop--only")
return {
column: elm.querySelector(".data-cell .desktop--only") ? elm.querySelector(".data-cell .desktop--only").textContent : "#",
@DIVISHAD
DIVISHAD / tickertape-report-exporter-latest.js
Created August 19, 2024 07:07
To export tickertape screener results
const scrapeData = () => {
const sections = document.querySelectorAll("#screener-table > table");
const headingElements = sections[0].querySelectorAll("th");
const scrapedData = Array.from(headingElements).map(elm => {
const selector = elm.getAttribute("id") === "name" ? "data-col" : elm.getAttribute("id") + "-col";
const rowElements = sections[0].querySelectorAll('tbody')[0].querySelectorAll("." + selector + " .ellipsis .desktop--only")
return {
column: elm.querySelector(".data-cell .desktop--only") ? elm.querySelector(".data-cell .desktop--only").textContent : "#",