I have this code in Python
from web3 import Web3
from lxml import html
import requests
import random
from colorama import Fore, Style
from hdwallet import HDWallet
from hdwallet.symbols import ETH as SYMBOL
z=0
w3 = Web3(Web3.HTTPProvider("http://localhost:8551", request_kwargs={'timeout': 60}))
f = open("ethkey.txt", "r")
password = "any"
while True:
Linereader = f.readline(-1)
Linereader = Linereader[:64]
w3.geth.personal.import_raw_key(Linereader,password)
z=z+1
print("OK")
continue
f.close()
This program gives:
server refused to connect (not Authorized 401)
Can you please help?
I tried to enable personal from Geth, same problem persists.
I'm trying to import a private keys file into Geth using Web3 as the list is long.