我无法使用我的Selenium代码在CookieClicker网站上绕过语言问题
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)
driver.get("https://orteil.dashnet.org/cookieclicker/")
actions = ActionChains(driver)
driver.implicitly_wait(10)
language = driver.find_element_by_id("langSelect-EN")
actions.click(language).perform()
我找到了该语言的ID,trust .click()。percor() 但是我的代码并不努力绕过 site 的语言障碍。我想念有人可以帮我吗?
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)
driver.get("https://orteil.dashnet.org/cookieclicker/")
actions = ActionChains(driver)
driver.implicitly_wait(10)
language = driver.find_element_by_id("langSelect-EN")
actions.click(language).perform()
I found the id of the language, tried .click().perform()
but my code is not working to bypass the site's language barrier. what am I missing can someone help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果任何人在将来遇到此问题的
情况
In case anyone encounter this problem in the future use
from selenium.webdriver.common.by import By
and the working code is like that
简单
就足够了 - 无需使用动作
Simple
should be enough - no need to use Actions