我正在尝试使用网络浏览器下载.pdf文件
问题是.pdf文件没有直接链接,因为网站会根据用户输入创建pdf文件,然后回复pdf
包含的代码将填充所有数据,并在需要时单击下一步
在我用代码填充数据并单击“下载”后,Internet Explorer上的新页面打开,并且没有任何事情发生,而不是下载文件
如何通过程序下载pdf文件
这是我的代码
Imports System.Net
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
WebBrowser1.Navigate("https://www.misim.gov.il/gmIshurim/firstPage.aspx")
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
WebBrowser1.Document.GetElementById("rbMeshalem").InvokeMember("click")
WebBrowser1.Document.GetElementById("btnNext").InvokeMember("click")
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
WebBrowser1.Document.GetElementById("txtMisTikMeshalem").SetAttribute("value", "510001001")
WebBrowser1.Document.GetElementById("txtTik1").SetAttribute("value", "510000367")
WebBrowser1.Document.GetElementById("btnNext").InvokeMember("click")
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
WebBrowser1.Document.GetElementById("cbSelectAll").InvokeMember("click")
WebBrowser1.Document.GetElementById("btnPrintIshur").InvokeMember("click")
End Sub
End Class