| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 610 人关注过本帖, 1 人收藏
标题:网站POST数据 搜索内容的一个方法
只看楼主 加入收藏
nbwww
Rank: 8Rank: 8
等 级:贵宾
威 望:11
帖 子:332
专家分:804
注 册:2021-1-9
结帖率:88.24%
收藏(1)
已结贴  问题点数:20 回复次数:3 
网站POST数据 搜索内容的一个方法
Http = CreateObject("MSXML2.XMLHttp")
Http.Open("Post","https://www.,.F.)
Http.setRequestHeader("Host"," www.)
Http.setRequestHeader("Connection"," keep-alive")
Http.setRequestHeader("Content-Length"," 11")
Http.setRequestHeader("Cache-Control"," max-age=0")
Http.setRequestHeader("Upgrade-Insecure-Requests"," 1")
Http.setRequestHeader("Origin"," https://www.)
Http.setRequestHeader("User-Agent"," Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36")
Http.setRequestHeader("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")
Http.setRequestHeader("Sec-Fetch-Site"," same-origin")
Http.setRequestHeader("Sec-Fetch-Mode"," navigate")
Http.setRequestHeader("Sec-Fetch-User"," ?1")
Http.setRequestHeader("Sec-Fetch-Dest"," document")
Http.setRequestHeader("Referer"," https://www.)
Http.setRequestHeader("Accept-Encoding"," gzip, deflate, br")
Http.setRequestHeader("Accept-Language"," zh-CN,zh;q=0.9")
Http.setRequestHeader("Content-Type","application/x-www-form-urlencoded")

postdata="searchkey=88"           &&替换要搜索的内容
Http.send(postdata)
_CLIPTEXT=Http.ResponseText

有没有更简单的办法?


搜索更多相关主题的帖子: application POST 内容 com Http 
2023-05-18 21:30
sdta
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:江苏省连云港市
等 级:版主
威 望:335
帖 子:9841
专家分:27213
注 册:2012-2-5
收藏
得分:10 
Http = CreateObject("MSXML2.XMLHttp")
Http.Open("Post","https://www.,.F.)
*!*    Http.setRequestHeader("Host"," www.)
*!*    Http.setRequestHeader("Connection"," keep-alive")
*!*    Http.setRequestHeader("Content-Length"," 11")
*!*    Http.setRequestHeader("Cache-Control"," max-age=0")
*!*    Http.setRequestHeader("Upgrade-Insecure-Requests"," 1")
*!*    Http.setRequestHeader("Origin"," https://www.)
*!*    Http.setRequestHeader("User-Agent"," Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36")
*!*    Http.setRequestHeader("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")
*!*    Http.setRequestHeader("Sec-Fetch-Site"," same-origin")
*!*    Http.setRequestHeader("Sec-Fetch-Mode"," navigate")
*!*    Http.setRequestHeader("Sec-Fetch-User"," ?1")
*!*    Http.setRequestHeader("Sec-Fetch-Dest"," document")
*!*    Http.setRequestHeader("Referer"," https://www.)
*!*    Http.setRequestHeader("Accept-Encoding"," gzip, deflate, br")
*!*    Http.setRequestHeader("Accept-Language"," zh-CN,zh;q=0.9")
Http.setRequestHeader("Content-Type","application/x-www-form-urlencoded")

postdata="searchkey=88"           &&替换要搜索的内容
Http.send(postdata)
_CLIPTEXT=Http.ResponseText

坚守VFP最后的阵地
2023-05-18 23:33
nbwww
Rank: 8Rank: 8
等 级:贵宾
威 望:11
帖 子:332
专家分:804
注 册:2021-1-9
收藏
得分:0 
这只是个测试网站   很多网站如果不提交协议头会出错的

[此贴子已经被作者于2023-5-19 06:21编辑过]

2023-05-19 06:14
吹水佬
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:451
帖 子:10607
专家分:43186
注 册:2014-5-20
收藏
得分:10 
请求标头大都会自动配置,有些要声明或验证的主要有Content-Type、Cookie、Referer
2023-05-19 07:28
快速回复:网站POST数据 搜索内容的一个方法
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020464 second(s), 11 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved