Answer the question
In order to leave comments, you need to log in
Run for no more than 5 times?
driver.get("https://www.site.com/arr-c/")
try:
for a in driver.find_elements_by_xpath('.//a'):
print(a.get_attribute('href'))
except Exception as err:
print(err)
Answer the question
In order to leave comments, you need to log in
for a in driver.find_elements_by_xpath('.//a')[:5]:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question