Home > Software design >  selenium python page does not work - unknown error: net::ERR_NAME_NOT_RESOLVED
selenium python page does not work - unknown error: net::ERR_NAME_NOT_RESOLVED

Time:08-24

So Im working on a project for a twitch streamer, I have a problem with this file so it does not run,also I tried different ways to change the code but wasn't able to find a solution, here is my code

import pickle
import time
import undetected_chromedriver as uc

if __name__ == "__main__":
driver = uc.Chrome()
driver.get("https://wwww.twitch.tv/login")

input("Press enter when you have logged in")
cookie_name = input("What is the name of the account?")
pickle.dump(driver.get_cookies(), open(f"{cookie_name}.dump", "wb"))

when i try to run this code in terminal I get this error

Traceback (most recent call last):
File "cookie_monster.py", line 8, in <module>
driver.get("https://wwww.twitch.tv/login")
File "/home/alex/.local/lib/python3.8/site- 
packages/undetected_chromedriver/__init__.py", line 535, in get
return super().get(url)
File "/home/alex/.local/lib/python3.8/site- 
packages/selenium/webdriver/remote/webdriver.py", line 437, in get
self.execute(Command.GET, {'url': url})
File "/home/alex/.local/lib/python3.8/site-
packages/selenium/webdriver/remote/webdriver.py", line 425, in execute
self.error_handler.check_response(response)
File "/home/alex/.local/lib/python3.8/site- 
packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: 
net::ERR_NAME_NOT_RESOLVED
(Session info: chrome=104.0.5112.101)
Stacktrace:
#0 0x55b8bc94b403 <unknown>
#1 0x55b8bc751778 <unknown>
#2 0x55b8bc74b565 <unknown>
#3 0x55b8bc73f296 <unknown>
#4 0x55b8bc740232 <unknown>
#5 0x55b8bc73f562 <unknown>
#6 0x55b8bc73e995 <unknown>
#7 0x55b8bc73d65b <unknown>
#8 0x55b8bc73dac2 <unknown>
#9 0x55b8bc7531e2 <unknown>
#10 0x55b8bc7ba3cf <unknown>
#11 0x55b8bc7a6a02 <unknown>
#12 0x55b8bc7b9c74 <unknown>
#13 0x55b8bc7a68f3 <unknown>
#14 0x55b8bc77c0d8 <unknown>
#15 0x55b8bc77d205 <unknown>
#16 0x55b8bc992e3d <unknown>
#17 0x55b8bc995db6 <unknown>
#18 0x55b8bc97c13e <unknown>
#19 0x55b8bc9969b5 <unknown>
#20 0x55b8bc970970 <unknown>
#21 0x55b8bc9b3228 <unknown>
#22 0x55b8bc9b33bf <unknown>
#23 0x55b8bc9cdabe <unknown>
#24 0x7fea9d1e4609 <unknown>

any ideas how to fix this? Im not very good at python

CodePudding user response:

The url you are giving here driver.get("https://wwww.twitch.tv/login") is unreachabel you should give a correct link and then you wont get this message

CodePudding user response:

You have passed a invalid url_string as an argument to get(), Instead of four w:

https://wwww.twitch.tv/login

It should have been three w:

https://www.twitch.tv/login
  • Related