من کد زیر رو دارم function findelement(xpathExpression) { const result =…
- User
من کد زیر رو دارم function find_element(xpathExpression) { const result = document.evaluate( xpathExpression, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null );
codereturn result.singleNodeValue;}
function get_elements() { return { first_input_element: find_element("/html/body/div[1]/div[1]/div[2]/div[2]/div[1]/div/input"), secound_input_element: find_element("/html/body/div[1]/div[1]/div[2]/div[2]/div[3]/div/input"), lis_element: find_element("/html/body/div[1]/div[1]/div[2]/div[2]/div[1]/div/div/div[3]/div[1]"), matic_element: find_element("/html/body/div[1]/div[1]/div[2]/div[2]/div[1]/div/div/div[3]/div[4]"), usdt_element: find_element("/html/body/div[1]/div[1]/div[2]/div[2]/div[1]/div/div/div[3]/div[5]"), near_element: find_element("/html/body/div[1]/div[1]/div[2]/div[2]/div[1]/div/div/div[3]/div[6]") }; }
function get_transfer_value(secound_input_element) { return secound_input_element.value; }
function click_on_element(element) { if (element) { element.click(); } }
function set_value(element, value_item) { if (element) { element.value = value_item; const event = new Event('input', { bubbles: true }); element.dispatchEvent(event); } }
function click_sec_near() { find_element("/html/body/div[1]/div[1]/div[2]/div[2]/div[3]/div/div/div[3]/div[4]").click(); }
function click_sec_usdt() { find_element("/html/body/div[1]/div[1]/div[2]/div[2]/div[3]/div/div/div[3]/div[2]").click(); }
function click_swap_button() { find_element("/html/body/div[1]/div[1]/div[2]/div[2]/button").click(); }
function click_confirm_button() { find_element("/html/body/div[1]/div[1]/div[2]/div[3]/div[1]/div/div/div/div[3]/button[2]").click(); }
function process_data() { const elements = get_elements(); const first_usdt = 3.5; var transfer_value;
code - Assistant