Skip to content Skip to sidebar Skip to footer

Click On Buttons With Images

I'm trying to crawl this page: http://www.1800contractor.com/d.HI.html I made this script from selenium import webdriver URL = 'http://www.1800contractor.com/d.GA.html' zip_code

Solution 1:

There is a simpler way to solve it - send the newline character at the end of your ZIP code - it would automatically submit the form:

text_box.send_keys(zip_codes[0] +"\n")

Works for me.

If you insist on clicking the button/"button image", you can locate it using the following CSS selector matching a part of the src attribute value and trying to keep it readable:

driver.find_element_by_css_selector("input[src*=go_btn]").click()

Post a Comment for "Click On Buttons With Images"