当我从 CMD 运行下面的代码时,它什么也不做,也不会抛出任何错误。我的其他 Python 程序运行良好。代码有什么问题吗?
from selenium import webdriver
from time import sleep
class TinderBot():
def __init__(self):
self.driver = webdriver.Chrome()
def login(self):
self.driver.get('https://tinder.com')
sleep(2)
fb_btn = self.driver.find_element_by_xpath('//*[@id="content"]/div/div[1]/div/div/main/div/div[2]/div[2]/div/div/span/div[2]/button')
fb_btn.click()
# switch to login popup
base_window = self.driver.window_handles[0]
self.driver.switch_to.window(self.driver.window_handles[1])
# vlozit email
email_in = self.driver.find_element_by_xpath('//*[@id="email"]')
email_in.send_keys('email')
# vlozit heslo
password_in = self.driver.find_element_by_xpath('//*[@id="pass"]')
password_in.send_keys('password')
# submitnout
prihlasit_se = self.driver.find_element_by_xpath('//*[@id="loginbutton"]')
prihlasit_se.click()
aluckdog
慕哥9229398
相关分类