'Malformed URL after deleting row with SQLite

I wrote a script that can open tabs in the TOR browser with a for loop. I used a database as the list the loop had to go through and one of the last links gave the error : invalid URL (the other URLS still worked. I deleted the row from my database but now the whole loop does not work and I don't know how to fix this. Can someone help me?

enter code here

create_table()\
onion()\
zoekterm = input()\
url_list = []\
url_list.append(cursor.execute("SELECT URL FROM dark_web").fetchall())\
url_list1 = url_list[0]\
count = 0

for url in url_list1:\
    print(url[0]) \
    driver.get(url[0])\
    timeout=60
    print("URL bezocht")\
    count += 1

I am connected to TOR through Selenium and my databases are imported.
Error: selenium.common.exceptions.InvalidArgumentException: Message: Malformed URL: URL constructor: Leaktheanalyst.fireeye62c3da3fnosymmmcqcty7rl7cjucpbkzaz275a4qs5fgkzhad.onion is not a valid URL.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source