I'm trying to get transaction data from etherscan and would like to get exactly what is represented in the "Transaction Action" section of the transaction details.
For example, in this transaction (transaction hash: 0x62f4c14dabbd54bba3657780fffcf258cb358bbb5a8beb7e4eddc9e05b963844) you can see that 1,587.116348149284787459 BBANK was swapped for 0.076451012303912703 ether, which was then swapped for 15,298.900710437101191036 PAD. How is this information parsed from the logs? I've seen many posts asking similar questions but have not seen an answer that explains exactly how this information is pulled.
Looking at the logs, I can see the contract addresses for the various tokens involved in the transaction. But I'm not understanding how the data in the logs gets converted to this straightforward transaction summary.
I've been primarily using python with Web3 and the etherscan API to fetch and parse the data.