- Go Web Scraping Quick Start Guide
- Vincent Smith
- 253字
- 2021-07-02 13:58:15
Go is simple
Beyond the architecture of the Go programming language itself, the standard library offers all the right packages you need to make web scraping easy. Go offers a built-in HTTP client in the net/http package that is fully-featured out of the box, but also allows for a lot of customization. Making an HTTP request is as simple, as follows:
http.Get("http://example.com")
Also a part of the net/http package are utilities to structure HTTP requests, HTTP responses, and all of the HTTP status codes, which we will dive into later in this book. You will rarely need any third-party packages to handle communication with web servers. The Go standard library also has tools to help analyze HTTP requests, quickly consume HTTP response bodies, and debug the requests and responses in your web scraper. The HTTP client in the net/http package is also very configurable, letting you tune special parameters and methods to suit your specific needs. This typically will not need to be done, but the option exists if you encounter such a situation.
This simplicity will help eliminate some of the guesswork of writing code. You will not need to determine the best way to make an HTTP request; Go has already worked it out and provided you with the best tools you need to get the job done. Even when you need more than just the standard library, the Go community has built tools that follow the same culture of simplicity. This certainly makes integrating third-party libraries an easy task.
- FreeSWITCH 1.2
- C++黑客編程揭秘與防范
- 計算機網(wǎng)絡(luò)安全實訓(xùn)教程(第二版)
- 農(nóng)產(chǎn)品物聯(lián)網(wǎng)研究與應(yīng)用
- 無人機通信
- 互聯(lián)網(wǎng)安全的40個智慧洞見:2015年中國互聯(lián)網(wǎng)安全大會文集
- React:Cross-Platform Application Development with React Native
- Yii Application Development Cookbook(Second Edition)
- Learning Swift(Second Edition)
- 通信十年:擁抱互聯(lián)網(wǎng)
- 網(wǎng)絡(luò)安全應(yīng)急響應(yīng)技術(shù)實戰(zhàn)指南
- 異構(gòu)蜂窩網(wǎng)絡(luò)關(guān)鍵理論與技術(shù)
- 現(xiàn)代通信系統(tǒng)(第5版)
- 深入理解計算機網(wǎng)絡(luò)
- 圖神經(jīng)網(wǎng)絡(luò)前沿