HtmlAgilityPack LoadFromBrowser method not found - html-agility-pack

I am using HtmlAgilityPack 1.6.2 within a .NET Core 2.0 Console application. HtmlWeb.Load function works fine but LoadFromBrowser function is not available. I got a compiler error. The testing code is copied from the tutorial page so it should be correct. Please advise how to use the API.

The LoadFromBrowser method requires the WinForm WebBrowser to work.
Since there is not WebBrowser in .NET Core 2.0, this method is not available.
This method could be available in the future by replacing the WebBrowser by an open source browser but there is currently no short-term plan for it.
EDIT: Answer comment
Is there still no solution for this?
I didn't try it, but some package support web browser for .NET Standard such as : https://www.nuget.org/packages/Selenium.WebDriver
So perhaps if you use this package to retrieve the HTML and use it with HAP, that will work.

I have the same prob, installed Selenium.WebDriver, but don't know how to use it with HAP to wait until JS is loaded.

Related

ASP .NET 5 WEB API creating help page

I just got started working on ASP.NET 5. I want to have a help page for my methods, I have seen few examples for creating help pages but most of them are MVC specific. I have gone through Microsoft.AspNet.WebApi.HelpPage package, it creates an Area for help page but I am not using MVC pattern.
Any suggestions how can I create help page other than this area approach?
I would suggest looking at Swagger and SwaggerUI. Swagger is an open standard, using JSON to document an API, used by the likes of PayPal and Microsoft (check out Logic apps in the azure portal).
There are some open source implementations for .Net (both of which I have used), which will self document your API, just by adding the NuGet packages to your project and a little bit of configuration:
https://github.com/domaindrivendev/Swashbuckle
https://github.com/domaindrivendev/Ahoy
Swashbuckle is the original project and Ahoy is the new version targeting ASPNET5. When downloading the package from NuGet you will still get Swashbuckle, just make sure you tick "include pre-release", and if you need any documentation look at the original GitHub project.
SwaggerUI (which is also included in Swashbuckle) adds an interface which you can use to navigate and test your API, by default this is available from "/swagger/ui" when your project is running.
Here is a sample repo in GitHub I put together showing how it can be used: https://github.com/mattridgway/ASPNET5-SwaggerUI

WatiN and RadAsyncUpload

I am using WatiN to run some UI automated tests on my application that uses Telerik RadControls. I have been able to interact with most of telerik controls, except RadAsyncUpload.
Currently I am unable to upload a file using WatiN. I understand that telerik uses another testing platform, but I am looking to see if maybe someone can help me figure out how to use WatiN to uplad a file via the RadAsynUpload control.
<telerik:RadAsyncUpload ID="upAttachment" runat="server"AllowedFileExtensions=".pdf,.jpg,.jpeg,.gif,.png,.bmp" TabIndex="9">
Probably the test failure is caused by third party modules like silverlight, flash and file api which RadAsyncUpload uses. Try to set DisablePlugins="True". Note that this can break existing functionality like MultiFileSelection.

Plugin methods are missing in Firefox 3.6

We have a plugin that we use to enable printing and saving from our
app. We instantiate it using tag with all needed attributes,
and then call Save() or Print() method on the document.embeds[0]
object.
This used to work perfectly on Firefox 3.5 and earlier, but it no
longer works in Firefox 3.6. In 3.6, document.embeds[0].Save is null,
that is our custom methods are not defined on this object.
Any idea why this happens, and what has changed in Firefox 3.6 that
causes it? Any idea on how to debug it and find the cause? And most
important, any idea of a workaround that will allow us to access this
methods?
Thanks,
splintor
Got an answer in mozilla.dev.tech.plugins forum - Firefox 3.6 removes support for XPCOM. We will need to change our plugin according to one of the options suggested in the answer.

Firefox Gecko SDK : NPP_GetValue not getting called

I have tried out the NPRuntime sample provided with the Gecko SDK 1.9.1 with the help of this link.
It works perfectly fine with Firefox 3.6.
Following the above steps I created a new scripting plugin (npmyplugin.dll). I am currently placing npmyplugin.dll in a folder other than Firefox/plugins. I am registering the associated mime-type and plugin path in the registry. The plugin gets loaded properly. But now the browser is not calling NPP_GetValue.
I was suspecting that it must be because I am placing the plugin in a directory other than Firefox/plugins. Hence I did the same with npruntime.dll (the sample which comes with Gecko sdk). Suprisingly npruntime.dll scripting was working. Please guide me whether I missing anything important while creating the new plugin.
NPP_GetValue doesn't get called to get the NPObject until the first time you access it with javascript in many cases. When you do a getElementById, it will make the call.
Likely other calls to GetValue are being made, but you aren't seeing them because you aren't handling them. However, that's still not guaranteed.
Sorry for replying so late. I somehow solved the problem. I was embedding the plugin using tag
then i wrote a small javascript code
var MyWorkingPlugin = document.getElementById('MyPlugin');
It seems that after executing the above javascript NPP_GetValue was called. Currently I have no convincing reason why it happened but it worked and I am happy for the moment. If anyone can explain the above behaviour please let us know.

npapi - javascript doesnt load the content of a plugin

I wrote a firefox plugin using C++ and used the <EMBED> to load it to html.
In javascript I got the embedded plugin by using document.getElementByID,
but when I tried to call a plugin function, the function was undefined. Moreover,
plugins constructors did not run while loading the page.
The same html file and plugin seems to work on some computers, while it doesnt work on others.
Does anyone have an idea what might by wrong?
How can I debug such an issue?
Can you reproduce it on your computer at first? If not, then try to figure out what systems, browsers, architecture, versions, they are using.
I recall, there are many GECKOSDK's, and each one has a specific version it works for. https://developer.mozilla.org/en/gecko_sdk For example, different SDK's for Firefox 1.5-2.0, FireFox 3.0, Firefox 3.5, and Firefox 3.5
For different browers, make sure you are exposing the right DLL Exports, browsers can vary: http://git.webvm.net/?p=npsimple is a good starting point. You can use firebreath.googlecode.com too as an alternative.
My suggestion would be to use an object tag instead of <embed>. In my experience, doesn't seem to work as reliably.
If I had more information on how your plugin is structured (are you using XPCOM or npruntime?), I might be able to help more.

Resources