I'm creating a Bot that searches a word in google and writes to a txt file all the links found in the search
I'm currently trying to find a keyword on the search result page, I store the links that contain that keyword in a variable and save it in txt:
string mencoesDaPalavra = Driver.FindElements(By.PartialLinkText("Palavra a pesquisar")).ToString();
After "capturing" the links that contain the word I'm trying to write to the file like this:
StreamWriter file = new StreamWriter("new.txt");
file.Write(mencoesDaPalavra);
file.Close();
My attempt was not successful, the line recorded in the file does not match what I'm looking for .. how could I do it?
line written to file:
new.txt = "System.Collections.ObjectModel.ReadOnlyCollection'1 [OpenQA.Selenium.IWebElement]"