Dodanie wartosci na stronie

0

Mam problem z dodawaniem wartosci za pomoca selenium do strony. Walcze i nie mam pojecia jak za pomoca selenium namierzyc te obiekty i dodac im wartosc.
Prosta strona

<!DOCTYPE html>
<html>
<head>
    <title>Wprowadź dane</title>
</head>
<body>
    <input id="input1" type="text" placeholder="Wpisz wartość 1" />
    <input id="input2" type="text" placeholder="Wpisz wartość 2" />
    <input id="input3" type="text" placeholder="Wpisz wartość 3" />
    <input id="input4" type="text" placeholder="Wpisz wartość 4" />
    <input id="input5" type="text" placeholder="Wpisz wartość 5" />
    <input id="input6" type="text" placeholder="Wpisz wartość 6" />
    <button onclick="saveData()">Zapisz dane</button>

    <script>
        function saveData() {
            const value1 = document.getElementById('input1').value;
            const value2 = document.getElementById('input2').value;
            const value3 = document.getElementById('input3').value;
            const value4 = document.getElementById('input4').value;
            const value5 = document.getElementById('input5').value;
            const value6 = document.getElementById('input6').value;
            const newEntry = { value1, value2, value3, value4, value5, value6 };
            let entries = JSON.parse(localStorage.getItem('entries')) || [];
            
            entries.unshift(newEntry); 
            localStorage.setItem('entries', JSON.stringify(entries));
            
            window.location.href = "index.html"; 
        }
    </script>
</body>
</html>

Zapis i wyswietlanie wartosci dziala. Chce do kazdego pola dodac jakas wartosc.
Kombinuje na rozne sposoby i caly czas sypie bledami

            driver.get('http://localhost/add.html')
            time.sleep(2)
            input_field = driver.find_elements(By.ID,'input1')
            timos = str(now.strftime("%Y-%m-%d %H:%M:%S"))
            input_field[0].send_keys(timos)

Jak byscie zrobili dodanie danych do tych obiektow ?

0

Dobra temat rozwiazany, problem byl ze dawalem localhost.

1 użytkowników online, w tym zalogowanych: 0, gości: 1