4 ms·
For me the only use I have for IE is as a .net control to be able to access and manipulate the DOM in .net, for small web scrapping toy projects. I doubt the ne
by cm2187 8y ago
For me the only use I have for IE is as a .net control to be able to access and manipulate the DOM in .net, for small web scrapping toy projects. I doubt the new Edge will be integrated as well as IE was (if integrated at all), so I will miss that when it is gone.
- mlevental 8y agointeresting. how do you do this?
- cm2187 8y agoAdd a WebBrowser control (which is just a wrapper around IE), navigate to the page of your choice, then you can access the DOM with methods like webBrowser1.Document.GetElementById("someid") you can trigger javascript events or fill a form like: webBrowser1.Document.GetElementById("someid").SetAttribute("value", "login") webBrowser1.Document.GetElementById("someid").InvokeMember("click") There are ways to embed Edge or Chrome in a .net application but you can't access or manipulate the DOM (or you have to inject some javascript, which is not as neat as being to manipulate it directly in .net).
- mlevental 8y agoit's funny i just started learning f# on linux and just last night ran into issues around add webbrowser as form control. thanks though i'll try this on windows
- cheschire 8y agoCheck out Blazor[0], and you can touch the DOM through JS interop. 0: https://docs.microsoft.com/en-us/aspnet/core/razor-components/javascript-interop?view=aspnetcore-3.0 https://docs.microsoft.com/en-us/aspnet/core/razor-component...
- cm2187 8y agoI will certain look at Blazor when it has matured for creating websites, but I am not sure you can use it to scrap a third party website.
- ygra 8y agoFor web-scraping you could (for now) probably also use PowerShell with Invoke-WebRequest which runs the response through MSHTML, giving you fairly convenient access to various parts of the page as well as the complete DOM.