问个小问题

橘子皮... 2021-04-05 08:05:29

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12

Try
sUrl = "https://quizlet.com/": Link = ""
xmlhttp = DirectCast(WebRequest.Create(sUrl), HttpWebRequest)
xmlhttp.Timeout = 6000 : xmlhttp.AllowAutoRedirect = False
xmlhttp.Method = "GET": xmlhttp.KeepAlive = False
xmlhttp.Host = "quizlet.com"
xmlhttp.Headers.Add("upgrade-insecure-requests", "1")
xmlhttp.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36"
xmlhttp.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
xmlhttp.Headers.Add("sec-fetch-site", "none")
xmlhttp.Headers.Add("sec-fetch-mode", "navigate")
xmlhttp.Headers.Add("sec-fetch-dest", "document")
xmlhttp.Headers.Add("accept-language", "zh-CN,zh;q=0.9,en;q=0.8,fr;q=0.7,zh-TW;q=0.6,ja;q=0.5")
'xmlhttp.Headers.Add("accept-encoding", "gzip, deflate")
Using rep As HttpWebResponse = xmlhttp.GetResponse()
Link = rep.GetResponseHeader("Location")
End Using
Catch ex As WebException : If ex.Status <> WebExceptionStatus.Timeout Then Throw
Catch ex As Exception : Throw
Finally : xmlhttp.Abort() : xmlhttp = Nothing
End Try


模拟抓包抓到的发出去后返回 远程服务器返回错误: (403) 已禁止。
不知道什么原因导致的,请会的指点12
...全文
220 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
极客诗人 2021-04-06
  • 打赏
  • 举报
回复
如上所说 你可以对比后几次请求的头部标签...
X-i-n 2021-04-05
  • 打赏
  • 举报
回复
大概率是COOKIE上加验证了。第一次请求以后,把cookie存下来,后边所有请求都带上它们。

16,721

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧