我正在尝试打开网站,但出现InvalidSessionIdException。我想为学校制作机器人,也想制作vktarget.ru任务求解器。
VKtarget-网站,您可以通过在vk.com的公开页面和YouTube频道上订阅(喜欢或不喜欢视频)来赚钱。
完整错误:
Traceback (most recent call last):
File "C:/Users/Даниэль/PycharmProjects/math bot/bot.py", line 5, in <module>
browser = webdriver.Firefox(executable_path='C:\\Files\\geckodriver.exe')
File "C:\Users\Даниэль\PycharmProjects\math bot\venv\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 174, in __init__
keep_alive=True)
File "C:\Users\Даниэль\PycharmProjects\math bot\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "C:\Users\Даниэль\PycharmProjects\math bot\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Users\Даниэль\PycharmProjects\math bot\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\Даниэль\PycharmProjects\math bot\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidSessionIdException: Message:
代码:
from selenium import webdriver
phonum = str(input())
pasw = str(input())
browser = webdriver.Firefox(executable_path='C:\\Files\\geckodriver.exe')
browser.get('https://vk.com')
textarea = browser.find_element_by_css_selector('#index_email')
textarea.send_keys(phonum)
textarea = browser.find_element_by_css_selector('#index_pass')
textarea.send_keys(pasw)
submit = browser.find_element_by_css_selector('#index_login_button')
submit.click()