如何在python中使用selenium单击按钮?

时间:2018-05-10 11:22:02

标签: python selenium selenium-webdriver



<a class="button_small button_orange btn_apply" onclick="javascript:showApplyJob();">Apply Now</a>
&#13;
&#13;
&#13; 如何在python中使用selenium单击按钮?

网站的网址:Link

试过代码: -

 driver.find_element_by_css_selector('body > div.jobWrap > div.jobDetailWrap > div.job.hasScorecard > div.applyBtn_m > a').click()

1 个答案:

答案 0 :(得分:0)

使用此代码:

WebDriverWait(driver, 5).until(EC.element_to_be_clickable((By.CSS_SELECTOR,"div[class='applyBtn']>a")))
driver.find_element_by_css_selector('div[class='applyBtn']>a').click()