How to save PDf files in specific folder in c# selenium

Rakesh kumar 106 Reputation points
2022-04-28T19:19:38.793+00:00

I have stored data in string variable and i need to get download PDF file in specific folder. Could you please help me

string download = EdgeObj.Driver.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/div/div/div/div/div[1]/div/div/div/div/div/div/div[3]/div/div[1]/div/div[2]/pre")).Text;

Directory.CreateDirectory(@"C:\Users\" + Environment.UserName + @"\Desktop\Image Retrival\" + Todaysdate);
Directory.CreateDirectory(@"C:\Users\" + Environment.UserName + @"\Desktop\Image Retrival\" + Todaysdate + @"\" + UserName);

Developer technologies Windows Forms
Developer technologies .NET .NET Runtime
Developer technologies .NET .NET CLI
Microsoft Edge Microsoft Edge development
Developer technologies C#
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.