我正在尝试用python和selenium制作一个自动注册机器人。我要做的事情最多,因为它们不那么难。但自动取款机我被一个约会者困住了。代码可以打开日期框,但不能选择日期。另一个问题是,你不能在日期框中写任何东西,你必须在日期框中选择一个日期。在
我尝试了在stackoverflow上找到的各种方法,但是这个网站没有任何效果。在
站点:https://mobilepanel2.nielsen.com/enrol/home?l=de_de&pid=9
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.ui import WebDriverWait
b = webdriver.Chrome(r'''C:\Users\Florian\PycharmProjects\Auto_Reg\chromedriver''')
b.get('https://mobilepanel2.nielsen.com/enrol/home?l=de_de&pid=9')
b.find_element_by_xpath("//select[@id='platform']/option[contains(text(),'Android')]").click()
b.find_element_by_xpath("//select[@id='deviceType']/option[contains(text(),'Smartphone')]").click()
b.find_element_by_xpath("//label[contains(text(),'Männlich')]").click()
## until here, everything works fine
select = Select(b.find_element_by_name('birthDate'))
select.select_by_visible_text("13")
给你:
相关问题 更多 >
编程相关推荐