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);

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,177 questions
Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,858 questions
.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
324 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,401 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,131 questions
{count} votes