1

Test page

I'm using the above Indeed page as a test page for selenium. I want to automate clicking the 'apply' button so the form comes up using the Firefox webdriver. I have the following code.

from selenium import webdriver

driver = webdriver.Firefox()
driver.get('http://www.indeed.ca/cmp/Belwood-Poultry-Ltd./jobs/General-Labourer-41a34df8c87843f8?sjdu=vQIlM60yK_PwYat7ToXhk0ht1loLTVg3_Mbro-8i_Oq8QnPfsih5TP4MoBFYzPbENZnyl4Z8fkU7srETrjh8IA')
self.mouse = webdriver.ActionChains(self.driver)  
driver.find_element_by_class_name("indeed-apply").click()

There's no error generated but the apply button isn't clicked (nothing appears to happen). Obviously that HTML tag isn't the one attached to the javascript event that triggers the click and I'm not sure how to fix this.

Thank you

1
  • I don't see the button when I open the link. Check the source of the file and if the <a> tag is used for the button then try using find_element_by_link_text. If <button> tag has been used then try find_element_by_tag_name. Commented Oct 13, 2015 at 3:59

2 Answers 2

1

From what I see, the class name is not indeed-apply, but indeed-apply-button:

driver.find_element_by_class_name("indeed-apply-button").click()
Sign up to request clarification or add additional context in comments.

Comments

1

There are two Apply Now button so if you want to click the first one see below:

driver.find_elements_by_css_selector(".indeed-apply-button")[0].click()

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.