Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 99418

How to click the buttons A to Z using Selenium and Python within the webpage http://architects-register.org.uk/list/regions

$
0
0

http://architects-register.org.uk/list/regions

So i have this website which i want to be able to have the code click the button A, then B and C and so on. How should i do that. I tried this code which tries to get the value of the child of the element then click the buttons accordingly but it does not work. I suspect there's some other issues aside the error below.

from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

driver = webdriver.Firefox()

url = 'http://architects-register.org.uk/'
driver.get(url)

find_uk = driver.find_element_by_id('ctl00_hlCountiesT').click()

elements = alphabets[0].find_element_by_tag_name('li')

def getChild(el):
   return el.children[0].children[0]

for element in elements:
    element = element[elements]
    (getChild(element)).click()

NameError: name 'alphabets' is not defined


Viewing all articles
Browse latest Browse all 99418

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>