'pancakeswap abi with "swapExactTokensForETH"

using web3, python, pancakeswap, binance smart chain

when using "swapExactTokensForETH", I get the following error:

raise ABIFunctionNotFound(
web3.exceptions.ABIFunctionNotFound: ("The function 'swapExactTokensForETH' was not found in this contract's abi. ", 'Are you sure you provided the correct contract abi?')

my abi currently looks like this:

[{
        "inputs": [{
                "internalType": "uint256",
                "name": "amountOutMin",
                "type": "uint256"
            }, {
                "internalType": "address[]",
                "name": "path",
                "type": "address[]"
            }, {
                "internalType": "address",
                "name": "to",
                "type": "address"
            }, {
                "internalType": "uint256",
                "name": "deadline",
                "type": "uint256"
            }
        ],
        "name": "swapExactETHForTokens",
        "outputs": [{
                "internalType": "uint256[]",
                "name": "amounts",
                "type": "uint256[]"
            }
        ],
        "stateMutability": "payable",
        "type": "function"
    }
]

where do i get the abi with "swapExactTokensForETH" from? the contract abi from bsc scan does not help.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source