Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,
I am using PhantomJSDriver and ChromeDriver(Selenium) to scrap the data in console app. It is work at my local but while i have added on the server it is not working.
Could you please let me know about <PhantomJSDriver and ChromeDriver(Selenium)? It can work on server or not?

What I have tried:

public static void Initialize()
{

service = PhantomJSDriverService.CreateDefaultService();
Log.WriteToFile("Browser service create...");


baseUrl = ConfigurationManager.AppSettings["Base_URL"];
// var downloadDirectory = ConfigurationManager.AppSettings["DownloadPath"];
Log.WriteToFile("Browser init Start...");
string path = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
FilePath = System.IO.Path.Combine(path, "csv");
Log.WriteToFile("Browser path");
var chromeOptions = new PhantomJSOptions();
Log.WriteToFile("PhantomJSOptions object");
// chromeOptions.AddUserProfilePreference("download.default_directory", FilePath);
// chromeOptions.AddArguments(new List<string>() { "headless" });
// options.setBinary("/path/to/other/chrome.exe");
webDriver = new PhantomJSDriver(chromeOptions);
Log.WriteToFile("Scrapper Start...");

}
This is my browser initialization function
Posted
Updated 15-Mar-18 7:06am

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900