编辑代码


// http://q.10jqka.com.cn/
// 股票筛选-同花顺
for (let i = 1; i <= 20; i++) {
    const 涨跌幅 = Number(document.querySelector(`tbody tr:nth-child(${i}) > td:nth-child(5)`).innerText)
    const 换手 = Number(document.querySelector(`tbody tr:nth-child(${i}) > td:nth-child(8)`).innerText)
    const 量比 = Number(document.querySelector(`tbody tr:nth-child(${i}) > td:nth-child(9)`).innerText)
    const 流通市值 = Number(document.querySelector(`tbody tr:nth-child(${i}) > td:nth-child(13)`).innerText.replace('亿', ''))

    if (
        涨跌幅 >= 3 && 涨跌幅 <= 5
        && 换手 >= 5 && 换手 <= 10
        && 量比 >= 1
        && 流通市值 >= 50 && 流通市值 <= 200
    ) {
        document.querySelector(`tbody tr:nth-child(${i})`).style.backgroundColor = '#CCC'
    }
}