here's the full code to a scraping too generated by gpt:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Web Scraping Tool</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 20px;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
        }
        table, th, td {
            border: 1px solid #ddd;
        }
        th, td {
            padding: 8px;
            text-align: left;
        }
        th {
            background-color: #f2f2f2;
        }
        input[type="text"] {
            width: 100%;
            box-sizing: border-box;
        }
        button {
            padding: 5px 10px;
            margin-left: 5px;
        }
    </style>
</head>
<body>

    <h1>Web Scraping Tool</h1>
    <table>
        <thead>
            <tr>
                <th>Name</th>
                <th>URL</th>
                <th>Selector</th>
                <th>Result/Error</th>
                <th>Last Execution</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody id="scrape-table-body">
            <tr>
                <td><input type="text" id="new-name" placeholder="Enter name"></td>
                <td><input type="text" id="new-url" placeholder="Enter URL"></td>
                <td><input type="text" id="new-selector" placeholder="Enter Selector"></td>
                <td colspan="3"><button onclick="addNewRecord()">Add & Execute</button></td>
            </tr>
        </tbody>
    </table>

    <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
    <script>
        const recordsKey = 'scrapeRecords';

        document.addEventListener('DOMContentLoaded', loadRecords);

        function loadRecords() {
            const records = JSON.parse(localStorage.getItem(recordsKey)) || [];
            records.forEach((record, index) => {
                addTableRow(record, index);
            });
        }

        function addTableRow({name, url, selector}, index) {
            const tableBody = document.getElementById('scrape-table-body');
            const row = document.createElement('tr');

            row.innerHTML = `
                <td><input type="text" value="${name}" onchange="updateRecord(${index}, 'name', this.value)"></td>
                <td><input type="text" value="${url}" onchange="updateRecord(${index}, 'url', this.value)"></td>
                <td><input type="text" value="${selector}" onchange="updateRecord(${index}, 'selector', this.value)"></td>
                <td id="result-${index}">-</td>
                <td id="timestamp-${index}">-</td>
                <td>
                    <button onclick="executeRecord(${index})">Execute</button>
                    <button onclick="removeRecord(${index})">Remove</button>
                </td>
            `;
            tableBody.insertBefore(row, tableBody.lastChild);
        }

        function addNewRecord() {
            const name = document.getElementById('new-name').value;
            const url = document.getElementById('new-url').value;
            const selector = document.getElementById('new-selector').value;

            if (!name || !url || !selector) {
                alert('All fields are required!');
                return;
            }

            const record = {name, url, selector, result: '', timestamp: ''};
            let records = JSON.parse(localStorage.getItem(recordsKey)) || [];
            records.push(record);
            localStorage.setItem(recordsKey, JSON.stringify(records));

            const index = records.length - 1;
            addTableRow(record, index);
            executeScraping(url, selector, index);

            document.getElementById('new-name').value = '';
            document.getElementById('new-url').value = '';
            document.getElementById('new-selector').value = '';
        }

        function executeRecord(index) {
            const records = JSON.parse(localStorage.getItem(recordsKey)) || [];
            const {url, selector} = records[index];
            executeScraping(url, selector, index);
        }

        function executeScraping(url, selector, index) {
            const proxy = 'https://cors-anywhere.herokuapp.com/';
            axios.get(proxy + url)
                .then(response => {
                    const parser = new DOMParser();
                    const doc = parser.parseFromString(response.data, 'text/html');
                    const resultElement = doc.querySelector(selector);
                    const resultText = resultElement ? resultElement.textContent.trim() : 'No matches';
                    updateResult(index, resultText);
                })
                .catch(error => {
                    console.error(`Error fetching the URL: ${url}`, error);
                    updateResult(index, `Error: ${error.message}`);
                });
        }

        function updateResult(index, result) {
            const records = JSON.parse(localStorage.getItem(recordsKey)) || [];
            records[index].result = result;
            records[index].timestamp = new Date().toLocaleString();
            localStorage.setItem(recordsKey, JSON.stringify(records));

            document.getElementById(`result-${index}`).textContent = result;
            document.getElementById(`timestamp-${index}`).textContent = new Date().toLocaleString();
        }

        function updateRecord(index, field, value) {
            const records = JSON.parse(localStorage.getItem(recordsKey)) || [];
            records[index][field] = value;
            localStorage.setItem(recordsKey, JSON.stringify(records));
        }

        function removeRecord(index) {
            let records = JSON.parse(localStorage.getItem(recordsKey)) || [];
            records.splice(index, 1);
            localStorage.setItem(recordsKey, JSON.stringify(records));
            document.location.reload();
        }
    </script>
</body>
</html>

there is bug when the entry of selector is saved to cookie an the page is reloaded. The the selector is displayed incorrectly, for example [data-testid="pricing"] is displayed as [data-testid= for some reason, fix it and provide the full code with the fix