Github sitesine otomatik giriş yapcak bir kod yazdım username password yazıyor ama oturum aç'a tıklamıyor kodum şöyle:
from login import username, password
from selenium import webdriver
import time
class Github:
def __init__(self,username,password):
self.browser = webdriver.Chrome()
self.username = username
self.password = password
def signIn(self):
self.browser.get("https://github.com/login")
time.sleep(2)
self.browser.find_element_by_xpath("//*[@id='login_field']").send_keys(self.username)
self.browser.find_element_by_xpath("//*[@id='password']").send_keys(self.password)
time.sleep(1)
self.browser.find_element_by_xpath("//*[@id='login']/form/div[4]/font/font/input").click()
github = Github(username, password)
github.signIn()
Uzunca bir hata alıyorum hata da şöyle :
DevTools listening on ws://127.0.0.1:52628/devtools/browser/0d0fbc16-f086-4817-ad28-f1469e9afe7c
[23516:25032:0730/140817.152:ERROR:device_event_log_impl.cc(208)] [14:08:17.152] Bluetooth: bluetooth_adapter_winrt.cc:1074 Getting Default Adapter failed.
Traceback (most recent call last):
File "c:/Users/COMPASS/Desktop/Emirhan/Emirhan/PYTHON Visual Code/Python.py", line 17, in <module>
github.signIn()
File "c:/Users/COMPASS/Desktop/Emirhan/Emirhan/PYTHON Visual Code/Python.py", line 15, in signIn
self.browser.find_element_by_xpath("//[@id='login']/form/div[4]/font/font/input").click()
File "C:\Users\COMPASS\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "C:\Users\COMPASS\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 976, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "C:\Users\COMPASS\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\COMPASS\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//[@id='login']/form/div[4]/font/font/input"}
(Session info: chrome=84.0.4147.105)
Yardımcı olabilecek var mı?
Dipnot : Resim Eklemeye Çalıştım Eklenmiyor Nasıl Eklenecek ?