Kayra Berk Tuncer
Kayra Berk Tuncer

Reputation: 395

Using Robot Framework and Seleniumlibrary, extracting data and saving to txt file

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

Answers (2)

Kayra Berk Tuncer
Kayra Berk Tuncer

Reputation: 395

I fixed the problem with Create File. Thank you for your time.

Upvotes: 0

DMart
DMart

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

Related Questions