-1

I don't intend to beat a dead horse here but I know there's selenium, awesomium, phantomjs, etc. They all don't seem compatible with mono and you have to kind of pull teeth to set it up.

I need a very light weight headless browser that supports javascript just to retrieve 1 cookie from a website. I cannot see that cookie with HttpClient because I believe javascript is generating it. I do not need any snapshots, any views, or anything crazy. I just want a simple headless browser that will output the cookies retrieved from a website.

I tried awesomium but it is not so awesome. It doesn't run well on mono / xamarin.

C O
  • 45
  • 10
  • Maybe share a snippet of code on how you are getting the cookies. And, if the site is public, the address and the cookie - someone might know something more. – Matthew Sep 20 '16 at 15:31
  • Download the javascript, figure out what's it's doing, and replicate that. – Joel Coehoorn Sep 20 '16 at 16:07

1 Answers1

0

This may, or may not, be what you want to do, but you can see what happens if you place a WebView on your screen.

https://developer.apple.com/reference/webkit/webview https://developer.xamarin.com/api/type/MonoMac.WebKit.WebView/

You can hide it, make it invisible, or whatever, and then ask that to load your page. Once the page is loaded, you can execute some JavaScript to get the cookie:

https://developer.apple.com/reference/webkit/webview/1408429-stringbyevaluatingjavascript https://developer.xamarin.com/api/member/MonoMac.WebKit.WebView.StringByEvaluatingJavaScriptFromString/p/System.String/

If it is just to get the cookie, you only have to do this once. But, I would really suggest that you make sure that it is being generated by JavaScript.

Matthew
  • 4,832
  • 2
  • 29
  • 55