Comprehensive Rust(Ukrainian) 202412
HTTP-клієнт, наприклад, reqwest. Вам також знадобиться спосіб пошуку лінків, ми можемо використати scraper. Нарешті, нам знадобиться спосіб обробки помилок, ми скористаємося thiserror. Створіть новий проект new link-checker 351 cd link-checker cargo add --features blocking,rustls-tls reqwest cargo add scraper cargo add thiserror Якщо cargo add завершується помилкою error: no such subcommand, будь ласка, = false [dependencies] reqwest = { version = "0.11.12", features = ["blocking", "rustls-tls"] } scraper = "0.13.0" thiserror = "1.0.37" Тепер ви можете завантажити стартову сторінку. Спробуйте з невеликим0 码力 | 396 页 | 1.08 MB | 10 月前3Comprehensive Rust(Persian ) 202412
new link-checker cd link-checker 349 cargo add --features blocking,rustls-tls reqwest cargo add scraper cargo add thiserror � � � cargo add � � error: no such subcommand � � � � � � � � � � � � � � � false ] dependencies [ reqwest = { version = "0.11.12", features = ["blocking", "rustls-tls " [ { scraper = "0.13.0 " thiserror = "1.0.37 " � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � : use reqwest::blocking::Client ; use reqwest::Url ; use scraper::{Html, Selector { ; use thiserror::Error ; enum Error } ReqwestError(#[from] reqwest::Error (0 码力 | 393 页 | 987.97 KB | 10 月前3Comprehensive Rust(English) 202412
you will need an HTTP client such as reqwest. You will also need a way to find links, we can use scraper. Finally, we'll need some way of handling errors, we will use thiserror. Create a new Cargo project new link-checker cd link-checker cargo add --features blocking,rustls-tls reqwest 341 cargo add scraper cargo add thiserror If cargo add fails with error: no such subcommand, then please edit the Cargo = false [dependencies] reqwest = { version = "0.11.12", features = ["blocking", "rustls-tls"] } scraper = "0.13.0" thiserror = "1.0.37" You can now download the start page. Try with a small site such0 码力 | 382 页 | 1.00 MB | 10 月前3Comprehensive Rust(简体中文) 202412
you will need an HTTP client such as reqwest. You will also need a way to find links, we can use scraper. Finally, we'll need some way of handling errors, we will use thiserror. Create a new Cargo project cargo new link-checker cd link-checker cargo add --features blocking,rustls-tls reqwest cargo add scraper cargo add thiserror 如 果 cargo add 操 作 失 败 并 显 示 error: no such subcommand,请 手 动 修 改 Cargo.toml 文件。添加下面列出的依赖项。 "rustls-tls"] } scraper = "0.13.0" thiserror = "1.0.37" 您现在可以下载初始页了。请尝试使用一个小网站,例如 https://www.google.org/。 您的 src/main.rs 文件应如下所示: use reqwest::blocking::Client; use reqwest::Url; use scraper::{Html, Selector};0 码力 | 359 页 | 1.33 MB | 10 月前3Comprehensive Rust(Español) 202412
you will need an HTTP client such as reqwest. You will also need a way to find links, we can use scraper. Finally, we'll need some way of handling errors, we will use thiserror. Create a new Cargo project new link-checker cd link-checker 345 cargo add --features blocking,rustls-tls reqwest cargo add scraper cargo add thiserror Si cargo add da error: no such subcommand, edita el archivo Cargo.toml de forma = false [dependencies] reqwest = { version = "0.11.12", features = ["blocking", "rustls-tls"] } scraper = "0.13.0" thiserror = "1.0.37" Ya puedes descargar la página de inicio. Prueba con un sitio pequeño0 码力 | 389 页 | 1.04 MB | 10 月前3Comprehensive Rust(繁体中文)
顯 示 error: no such subcommand,請 手 動 編 輯 Cargo.toml 檔案。請新增下列依附元件。 您也需要設法找出連結。為此,我們可以使用 scraper: cargo add scraper 最後,我們需要處理錯誤的方法。為此,我們會使用 thiserror: cargo add thiserror cargo add 呼叫會更新 Cargo.toml 檔案,如下所示: "rustls-tls"] } scraper = "0.13.0" thiserror = "1.0.37" 您現在可以下載起始網頁。請以小型網站嘗試這項操作,例如 https://www.google.org/。 src/main.rs 檔案應如下所示: use reqwest::blocking::Client; use reqwest::Url; use scraper::{Html, Selector}; std::sync::{mpsc, Arc, Mutex}; use std::thread; use reqwest::blocking::Client; use reqwest::Url; use scraper::{Html, Selector}; use thiserror::Error; enum Error { ReqwestError(#[from] reqwest::Error), BadResponse(String)0 码力 | 358 页 | 1.41 MB | 10 月前3Comprehensive Rust(Português do Brasil) 202412
cliente HTTP como reqwest. Você também precisará de uma maneira de encontrar links, podemos usar scraper. Por fim, precisaremos de alguma maneira de lidar com erros, usaremos thiserror. Crie um novo projeto new link-checker cd link-checker cargo add --features blocking,rustls-tls reqwest 346 cargo add scraper cargo add thiserror Se cargo add falhar com error: no such subcommand, edite o arquivo Cargo.toml = false [dependencies] reqwest = { version = "0.11.12", features = ["blocking", "rustls-tls"] } scraper = "0.13.0" thiserror = "1.0.37" Agora você pode baixar a página inicial. Tente com um pequeno site0 码力 | 389 页 | 1.05 MB | 10 月前3Comprehensive Rust(한국어) 202412
다 면 Cargo.toml 파 일 을 직 접 수 정 해 도 됩 니 다. 아 래 에 전 체 의 존 성 내 용 이 있 습 니 다. 링크를 찾기 위해서 scraper 도추가합니다: cargo add scraper 마지막으로 오류 처리하는 방법으로 thiserror 도 추가합니다: 327 cargo add thiserror 모든 cargo add 가 끝나면 "rustls-tls"] } scraper = "0.13.0" thiserror = "1.0.37" 이제 https://www.google.org/ 같은 웹 페이지를 탐색할 수있습니다. rc/main.rs 파일은 아래와 같습니다: use reqwest::blocking::Client; use reqwest::Url; use scraper::{Html, Selector}; std::sync::{mpsc, Arc, Mutex}; use std::thread; use reqwest::blocking::Client; use reqwest::Url; use scraper::{Html, Selector}; use thiserror::Error; enum Error { ReqwestError(#[from] reqwest::Error), BadResponse(String)0 码力 | 369 页 | 1.29 MB | 10 月前3Comprehensive Rust(日语) 202412
you will need an HTTP client such as reqwest. You will also need a way to find links, we can use scraper. Finally, we'll need some way of handling errors, we will use thiserror. Create a new Cargo project cargo new link-checker cd link-checker cargo add --features blocking,rustls-tls reqwest cargo add scraper cargo add thiserror 340 cargo add が error: no such subcommand で失敗する場合は、Cargo.toml フ ァイルを手動で編集し = false [dependencies] reqwest = { version = "0.11.12", features = ["blocking", "rustls-tls"] } scraper = "0.13.0" thiserror = "1.0.37" これで、スタートページをダウンロードできるようになりました。https://www.google.org/ の ような小規模なサイトで試してみましょう。0 码力 | 381 页 | 1.36 MB | 10 月前3
共 9 条
- 1