首页 > 其他分享 >自写爬虫工具——transfer-headers

自写爬虫工具——transfer-headers

时间:2023-05-25 10:36:46浏览次数:43  
标签:zh 自写 no transfer cache Accept headers Sec Fetch


transfer-headers,转换请求头

这两天趁有时间浅学了一下易语言,之前一直用python写工具,但python写启动软件慢,而且编译文件太大,
易语言学的很浅,用中文写很不习惯,==
因为经常做爬虫,经常要把请求头转换到python/代码里,每次做重复工作浪费时间,就自己写了这么个小工具,
有的人会说,转换成、curl,但 比如fiddler不支持,并且有的站转换会出错,
比如说

Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Cache-Control: no-cache
Connection: keep-alive
Cookie: HMACCOUNT=5B8D64B596; HMACCOUNT_BFESS=5B8D65AEAAAA-peeRytO957XEvqHNt7XItP0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAxY3GAMWNxgWX;__yjl_duid=1_400fa6f67541a851a327
DNT: 1
Host: hm.baidu.com
Pragma: no-cache
Referer: https://www.iloveyou.cn/forum.php
Sec-Fetch-Dest: script
Sec-Fetch-Mode: no-cors
Sec-Fetch-Site: cross-site
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.3987.87 Safari/5737.36 SE 2.X MetaSr 51.0

自写爬虫工具——transfer-headers_易语言

自写爬虫工具——transfer-headers_php_02

自写爬虫工具——transfer-headers_易语言_03

'Accept':'*/*',
'Accept-Encoding':'gzip,deflate,br',
'Accept-Language':'zh-CN,zh;q=0.9',
'Cache-Control':'no-cache',
'Connection':'keep-alive',
'Cookie':'HMACCOUNT=5B8D64B596;HMACCOUNT_BFESS=5B8D65AEAAAA-peeRytO957XEvqHNt7XItP0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAxY3GAMWNxgWX;__yjl_duid=1_400fa6f67541a851a327',
'DNT':'1',
'Host':'hm.baidu.com',
'Pragma':'no-cache',
'Referer':'https://www.iloveyou.cn/forum.php',
'Sec-Fetch-Dest':'script',
'Sec-Fetch-Mode':'no-cors',
'Sec-Fetch-Site':'cross-site',
'User-Agent':'Mozilla/5.0(WindowsNT10.0;WOW64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/89.0.3987.87Safari/5737.36SE2.XMetaSr51.0',
headers = {
    'Accept': '*/*',
    'Accept-Encoding': 'gzip,deflate,br',
    'Accept-Language': 'zh-CN,zh;q=0.9',
    'Cache-Control': 'no-cache',
    'Connection': 'keep-alive',
    'Cookie': 'HMACCOUNT=5B8D64B596;HMACCOUNT_BFESS=5B8D65AEAAAA-peeRytO957XEvqHNt7XItP0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAxY3GAMWNxgWX;__yjl_duid=1_400fa6f67541a851a327',
    'DNT': '1',
    'Host': 'hm.baidu.com',
    'Pragma': 'no-cache',
    'Referer': 'https://www.iloveyou.cn/forum.php',
    'Sec-Fetch-Dest': 'script',
    'Sec-Fetch-Mode': 'no-cors',
    'Sec-Fetch-Site': 'cross-site',
    'User-Agent': 'Mozilla/5.0(WindowsNT10.0;WOW64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/89.0.3987.87Safari/5737.36SE2.XMetaSr51.0',
}

支持上下框同步浏览
一键复制,及清空
下面分享一下软件:蓝揍 源码:source code


标签:zh,自写,no,transfer,cache,Accept,headers,Sec,Fetch
From: https://blog.51cto.com/u_16128190/6345290

相关文章

  • AWS Transfer Family创建新用户
    第一步:在客户端机器先创建sshkey,登陆机器,然后输入命令:ssh-keygen找到publickey,稍后添加用户时需要。第二步:进入AWSConsole,IAM,创建Role具体json如下:{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"Service&......
  • SpringCloud gateway HttpHeadersFilters
    HttpHeadersFilter在将请求发送到下游之前应用于请求,例如在NettyRoutingFilter中。1、ForwardedHeadersFilterForwardedHeadersFilter创建一个Forwarded标头以发送到下游服务。它将当前请求的Host标头、scheme和端口添加到任何现有的Forwarded标头中。2、RemoveHopByHopH......
  • 论文阅读笔记《Residual Physics Learning and System Identification for Sim to rea
    ResidualPhysicsLearningandSystemIdentificationforSimtorealTransferofPoliciesonBuoyancyAssistedLeggedRobots发表于2023年。论文较新,未找到发表期刊。基于浮力辅助的足式机器人策略迁移的残差物理学习与系统识别SontakkeN,ChaeH,LeeS,etal.Resi......
  • import treeTransfer from "el-tree-transfer"; 全量树去除 选中的
    <template><div><tree-transfer:title="['源列表','目标列表']":from_data="fromData":to_data="toData":defaultProps="{label:'label'}"@add......
  • Using base64 encoding and decoding for file transfer in AX 2012
    Base64BinDataIfyouwanttotransfersmallfiledatausingAXanddonotwanttomakeuseofsharedfoldersorfileuploading,sendingyourfiledirectlyinsideyourXMLmessageasbase64encodedstringisagoodoption.Base64givesyouthepossibil......
  • 关于nginx如何对外部隐藏nginx版本号-以及Response Headers中的Server字段的nginx版本
    对于nginx作为web/http服务器发布了一个网站时,外部用户就可以通过浏览器进行访问到默认情况下,如果外部用户,访问了一个不存在的资源时,就会返回404错误,如下图所示这里我们可以发现在返回404错误时,下面居然也输出了web服务器(nginx)及其版本号1.22.1当然从 ResponseHeaders中......
  • (转载)Transfer-Encoding:chunked详解
    原文链接:Transfer-Encoding:chunked详解_transfer-encoding:chunked_公众号:流花鬼的博客-CSDN博客概念分块传输编码(Chunkedtransferencoding)是超文本传输协议(HTTP)中的一种数据传输机制,允许HTTP由网页服务器发送给客户端应用(通常是网页浏览器)的数据可以分成多个部分。分块......
  • 直播电商平台开发,用el-checkout-group实现穿梭框el-transfer效果
    直播电商平台开发,用el-checkout-group实现穿梭框el-transfer效果一:页面构建 <el-form-itemlabel="选择模块:"prop="pubTime">  <divclass="app-select">   <divclass="list">    <el-inputv-model="searchWord&qu......
  • Transferwise:以最快的速度最少的费用为你提供国际转账服务
    是否觉得国际转账银行有时高得离谱,大概这个地球上没有一个觉得银行的货币兑换收费低的吧,除非你在银行工作。但是,创业公司Transferwise就能将这个转账费用降到很低。产品公......
  • 临时上传服务器搭建 transfer.sh
    https://github.com/dutchcoders/transfer.shtransfer.sh   Easyandfastfilesharingfromthecommand-line.Thiscodecontainstheserverwitheverythingyo......