首页 > 解决方案 > VB.net 与网站交互(没有 WebBrowser)

问题描述

我想知道是否可以在没有 webbrowser 的情况下与该网站进行交互: https ://msoos.github.io/cryptominisat_web

我想用字符串填充编辑器元素,“按”运行,然后从输出元素中获取文本

我试过没有成功:

Dim request As HttpWebRequest = WebRequest.Create("https://msoos.github.io/cryptominisat_web/")
    request.Method = "POST"
    request.ContentLength = byteData.Length
    request.ContentType = "application/x-www-form-urlencoded"

    Dim requeststream As Stream = request.GetRequestStream()
    requeststream.Write(byteData, 0, byteData.Length)
    requeststream.Close()

    Dim postresponse As HttpWebResponse = request.GetResponse()

    Dim postreqreader As New StreamReader(postresponse.GetResponseStream())
    Dim thepage As String = postreqreader.ReadToEnd
    TextBoxMain.Text = thepage

标签: vb.nethttppostrequest

解决方案


那个特定的 Web 应用程序在 JavaScript 中在客户端工作。没有服务器可以发送文本。如果您不想使用浏览器,则需要使用独立的 JavaScript 解释器(如 V8 或 SpiderMonkey)并针对页面 JavaScript 的相关位手动设置它。


推荐阅读