Reputation: 395
I am currently developing a test automation using Using Robot Framework and Seleniumlibrary. My problem is taking the links on the website and saving them in a txt file. Is this possible? If possible, how is it done?
Upvotes: 1
Views: 949
Reputation: 395
I fixed the problem with Create File. Thank you for your time.
Upvotes: 0
Reputation: 2461
all_links = driver.find_elements_by_tag_name('a')
for a in all_links:
print(a.text) #text of the link
print(a.get_attribute("href")) #href of the link
instead of print, write out to a text file as you see fit.
Upvotes: 2