当前位置:网站首页>The sharp weapon of web automation -- curl
The sharp weapon of web automation -- curl
2022-07-22 07:37:00 【51CTO】
cURL Support HTTP、HTTPS、FTP agreement , Also support POST,cookie, Breakpoint continuation ,userAgent,extra header, The speed limit , File size limit , Progress bar, etc .
By default ,linux The distribution of often does not bring cURL, Self installation required .
cURL Usually output the downloaded file to stdout, Output progress information to stderr, If you don't want to display progress information , have access to --silent Options .
Simplest use :
Such a command will output the file to the terminal , If you want to write to a file , have access to -O Options .
If the output file name is not specified , Will use from URL File name resolved in , for example
So you get a index.html file .
If you can't get from URL The file name is resolved in , An error will be reported when the command is executed , So you can specify the file name :
Note that the former is -O, The latter is -o.
curl Support to continue downloading from a specific file offset ,
offset Is an integer in bytes .
If you only want to resume at breakpoints , It can be like this
We can use curl Storage cookie For a file
If you want to specify cookie
cookies Yes, it is key=value Given in the form of , Multiple cookie Separated by semicolons .
There are some web pages that will detect visits userAgent, At this time, if you want to access in the specified way , You need to specify userAgent
use -A and --user-agent It's the same .
alike , If you need to set the access header
If you only want to get the header of the request response , have access to -I perhaps -head
If bandwidth is limited , have access to --limit-rate To limit the download speed
Speed unit support k and m.
You can also specify the maximum file size to download
The file size unit here is byte.
curl The command also supports authentication
If you don't write password
Then knock back , You will be prompted to enter the password .
边栏推荐
- 287寻找重复数
- 如何编写sql语句?
- 浅谈负载
- Dynamics 365: how to create users in azure AD and add them to dynamics 365 Online
- Error 1053: The service did not respond to the start or control request in a timely fashion.问题排查
- G026-DB-GS-INS-03 OpenEuler 部署 OpenGauss(1主2备或多备)
- Dynamics 365: 详解虚实体(Virtual Entity) 从0到1
- Dynamics CRM: XrmToolBox插件推荐
- 狂神redis笔记06
- 《通信软件开发与应用》课程结业报告
猜你喜欢
Embedded development: seven skills of using RTOS
集合之HashSet
Keras深度学习实战(10)——迁移学习
Talking about load
Azure key vault (3): the difference between key and secret
Dynamics CRM: Dashboard(仪表板)中设置的实体显示不出来的问题
Dynamics CRM: 邮箱配置(三) - 配置Email Server Profiles和Mailboxes
Dynamics 365: how to remove the restriction that an entity can only create two access team templates
Dynamics 365: Comment créer des utilisateurs dans Azure ad et les ajouter à Dynamics 365 en ligne
TCL的折叠屏故事,资本市场会看好吗?
随机推荐
Isomorphism + cross end, knowing applet +kbone+ applet container is enough!
Keras deep learning practice (14) -- r-cnn target detection from scratch
软件推荐-办公软件
Application between azure service bus and dynamics 365 service endpoint
Keras' deep learning practice -- gender classification based on vgg19 model
Keras深度学习实战(14)——从零开始实现R-CNN目标检测
使用C#控制台程序读取Azure Service Bus队列中的消息
Dynamics 365: 如何在Azure AD中創建用戶並添加到Dynamics 365 Online中
Yyds dry goods inventory # solve the real problem of famous enterprises: how many people will little a meet at most
关于sql数据查询的语句
Special analysis of China's third-party payment market in 2022
mysql中的字段如何选择合适的数据类型呢?
Oracle about date field index usage test
Dynamics CRM: Dashboard(仪表板)中设置的实体显示不出来的问题
Let me show you eight fallacies in software design
四种常见的 POST 提交数据方式(application/x-www-form-urlencoded,multipart/form-data,application/json,text/xml)
Azure Key Vault(2):创建Azure Key Vault
Keras深度学习实战——基于VGG19模型实现性别分类
Azure key vault (2): create azure key vault
软件推荐-装机