How can I pass the value of js variables to python (eel)?

  • 0
    There is a js function that processes input and writes values ​​to variables.

    function logIn_js(){
                loginJS = document.getElementById('login').value;
                passwJS = document.getElementById('passw').value;

    <!DOCTYPE html>
            <meta charset="UTF-8">
            <title>Speed Parser</title>
            <script src="eel.js"></script>
            <link rel="icon" type="image/png" href="favicon.png">
            <link rel="stylesheet" href="instaParser.css">
            <link href=",[email protected],100&display=swap" rel="stylesheet">
        <input id="login" type="text" placeholder="Ваш логин" required="">
        <input id="passw" type="password" placeholder="Ваш пароль" required="">
        <div id="form_radio_block">
        <div class="form_radio_group">
            <div class="form_radio_group-item">
                <input id="radio-1" type="radio" name="radio" value="rFollowers" checked>
                <label for="radio-1">Подписчики</label>
            <div class="form_radio_group-item">
                <input id="radio-2" type="radio" name="radio" value="rFollowing">
                <label for="radio-2">Подписки</label>
            <div class="form_radio_group-item">
                <input id="radio-3" type="radio" name="radio" value="rLike">
                <label for="radio-3">Пост+like</label>
        <input id="urlPage" type="text" placeholder="URL профиля" required="">
        <button id="projectStart">START</button>
        <script src="" integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc=" crossorigin="anonymous"></script>
        <script type="text/javascript">
            function startParser_js() {
            function logIn_js(){
                loginJS = document.getElementById('login').value;
                passwJS = document.getElementById('passw').value;
            jQuery('#projectStart').on('click', function() {

    How to pass value of loginJS and passwJS variables in python.

    I use eel for the link.

    import time
    import random
    from selenium import webdriver
    import eel
    def iPfollowers():
        driver = webdriver.Chrome('C:\\Users\\Евгений\\Desktop\\chromedriver.exe')
        login = "ЗДЕСЬ ЗНАЧЕНИЕ JS ПЕРЕМЕННОЙ loginJS"
        passw = "ЗДЕСЬ ЗНАЧЕНИЕ JS ПЕРЕМЕННОЙ passwJS"
        urlInsta = ""
    JavaScript Atticus Miranda, Sep 12, 2019

  • 0 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!