如何在 HAP 中使用代理?这就是我到目前为止所拥有的......(没有运气)。
IPCHICKEN 只是用来测试 ip 地址。它显示的是我的 IP 地址,而不是我的代理的 IP 地址
Function GetPrice(ByVal AmazonURL As String, ByVal Delay As Integer)
Dim aHtml As New HtmlWeb
Dim ChromeAgent As String = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11"
aHtml.UserAgent = ChromeAgent
Dim proxy As New System.Net.WebProxy
Dim proxyAddress As New Uri("http://111.111.111/")
Dim aDoc As HtmlDocument = aHtml.Load("http://www.ipchicken.com", "GET", proxy, System.Net.CredentialCache.DefaultCredentials)
Dim aNode As HtmlAgilityPack.HtmlNode
aNode = aDoc.DocumentNode.SelectSingleNode("//div[@id='olpDivId']/span[2]")
If aNode.InnerText Is Nothing Then
End If
Dim UsedPrice1 As String = aNode.InnerText
Dim i As Integer = UsedPrice1.IndexOf("$")
Dim UsedPrice As Integer = UsedPrice1.Substring(i + 1)
System.Threading.Thread.Sleep(Delay)
Return UsedPrice
End Function