I built simple application in C# that is posting new link to google+ account, however it is starting the actual browser itself. I’m fine with C#, Python, PHP languages, maybe even something else.
I cannot use C# WebClient class since many interactions are based on JS so I need to somehow emulate the browser.
This is my C# code for selenium so you can understand what I’m trying to achive.
static void Main(string[] args)
{
IWebDriver driver;
FirefoxProfile firefoxProfile = new FirefoxProfile();
driver = new FirefoxDriver();
driver.Navigate().GoToUrl("https://accounts.google.com/ServiceLoginAuth");
driver.FindElement(By.Name("Email")).SendKeys("MYEMAIL");
driver.FindElement(By.Name("Passwd")).SendKeys("MYPASSWORD");
driver.FindElement(By.Name("signIn")).Click();
driver.Navigate().GoToUrl("https://plusone.google.com/_/+1/confirm?hl=en&url=http://site.com/");
System.Threading.Thread.Sleep(10000);
driver.FindElement(By.ClassName("e-U-a-fa")).Click();
Console.WriteLine("Done!");
Console.ReadLine();
}
That looks like a perfect use case for the Ruby library
capybara-webkit(https://github.com/thoughtbot/capybara-webkit) or my own, small Python scraping library, dryscrape, which is based on the former 🙂Both use the same C++ backend to create an in-memory, headless browser based on QtWebkit. I only tested it on Linux, though, but it should also be compile on Windows with some effort. People have done it with capybara-webkit, at least.