點擊右側訪問官網,點擊官網右上角注冊或登錄。

2.登錄成功以后就會自動進入儀表盤頁面,在右邊可以看到密鑰相關信息。

2. ScrapingBee 網絡抓取平臺 API密鑰可用性測試

在獲取API密鑰后,進行可用性測試是確保其正常工作的重要步驟。以下是使用curl進行測試的一個案例

以下接口為ScrapingBee 網絡抓取平臺接口中 網頁抓取 接口。

輸入:

curl --location --request GET 'https://app.scrapingbee.com/api/v1/?api_key=你的密鑰&url=https://blog.csdn.net/YonIE_Wang/article/details/144155643' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--header 'Accept: */*' \
--header 'Host: app.scrapingbee.com' \
--header 'Connection: keep-alive'

輸出:

結果以 JSON 格式返回,包含指定網頁的詳細信息。

<!DOCTYPE html><html lang="zh-CN"><head>
  <style>.passport-login-tip-container{<br>       position: fixed;<br>       font-family: -apple-system,SF UI Text,Arial,PingFang SC,Hiragino Sans GB,Microsoft YaHei,WenQuanYi Micro Hei,sans-serif;<br>       bottom: 24px;<br>       right: 24px;<br>       width: 368px;<br>       padding: 24px 16px;<br>       background: #fff;<br>       color: #555666;<br>       box-shadow: 0px 0px 10px 2px rgba(0,0,0,0.06);<br>       border-radius: 4px;<br>       z-index: 9999;<br>     }<br>     .passport-login-tip-container.dark { background: #404041; color: #fff; } <br>     .passport-login-tip-container p.tit { margin-bottom:16px; font-size: 14px; font-weight: 500;color: #222226; line-height: 22px;} <br>     .passport-login-tip-container.dark p.tit { color: #fff; } <br>     .passport-login-tip-container ul { display: flex; flex-wrap: wrap; } <br>     .passport-login-tip-container ul li { flex: 0 0 50%; margin-bottom: 16px; font-size: 0; } <br>     .passport-login-tip-container ul li span { font-size: 14px; font-weight: 400; line-height: 22px; vertical-align: middle; }<br>     .passport-login-tip-container ul li img { margin-right: 3px; width: 16px; height: 16px; vertical-align: middle; }<br>     .passport-login-tip-container button { border: none;margin-top: 8px; width: 100%; height: 40px; background: #FC5531; border-radius: 20px; font-size: 14px; font-weight: 500; color: #FFFFFF; transition: all .2s; line-height: 40px;}<br>     .passport-login-tip-container button:hover { background: #FC1944; }<br>     </style><meta charset="utf-8">
  <link rel="canonical" >
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta name="renderer" content="webkit">
  <meta name="force-rendering" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <meta name="report" content="{&quot;pid&quot;: &quot;blog&quot;, &quot;spm&quot;:&quot;1001.2101&quot;}">
  <meta name="referrer" content="always">
  <meta http-equiv="Cache-Control" content="no-siteapp"><link rel="alternate" media="handheld" href="#">
  <meta name="shenma-site-verification" content="5a59773ab8077d4a62bf469ab966a63b_1497598848">
  <meta name="applicable-device" content="pc">
  <link rel="shortcut icon" type="image/x-icon">
  <title>第一個程序——“Hello World“保姆級詳解-CSDN博客</title>
      <script type="text/javascript" charset="utf-8" async="" src="https://gsp0.baidu.com/yrwHcjSl0MgCo2Kml5_Y_D3/api/customsearch/apiaccept?sid=10742016945123576423&amp;v=2.0&amp;callback=csdn.afterBaiduSearchInit"></script><script async="" src="https://scripts.clarity.ms/0.8.23/clarity.js"></script><script src="https://zz.bdstatic.com/linksubmit/push.js"></script><script type="text/javascript" async="" src="https://g.csdnimg.cn/??asdf/1.1.3/trackad.js,iconfont/nav/iconfont-1.0.1.js"></script><script src="https://hm.baidu.com/hm.js?6bcd52f51e9b3dce32bec4a3997715ac"></script><script async="" src="https://www.clarity.ms/tag/lgtpix6r85"></script><script src="https://s3a.pstatp.com/toutiao/push.js?1abfa13dfe74d72d41d83c86d240de427e7cac50c51ead53b2e79d40c7952a23ed7716d05b4a0f683a653eab3e214672511de2457e74e99286eb2c33f4428830" id="ttzz"></script><script type="application/ld+json">
        {"datePublished":"2024-11-30T23:16:48+08:00","@type":"Article","author":[{"@type":"Person","name":"YonIE_Wang","url":"https://blog.csdn.net/YonIE_Wang"}],"dateModified":"2024-11-30T23:21:33+08:00","@context":"https://schema.org","headline":"第一個程序——“Hello World“保姆級詳解"}
      </script>
  <script>
    (function(){
      var el = document.createElement("script");
      el.src = "https://s3a.pstatp.com/toutiao/push.js?1abfa13dfe74d72d41d83c86d240de427e7cac50c51ead53b2e79d40c7952a23ed7716d05b4a0f683a653eab3e214672511de2457e74e99286eb2c33f4428830";
      el.id = "ttzz";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(el, s);
    })(window)
  </script>
      <meta name="keywords" content="hello world">
      <meta name="csdn-baidu-search" content="{&quot;autorun&quot;:true,&quot;install&quot;:true,&quot;keyword&quot;:&quot;hello world&quot;}">
  <meta name="description" content="文章瀏覽閱讀1.1k次,點贊7次,收藏6次。通俗點就是說是printf的大哥,大哥有很多小弟,計算機記不住,只能記住大哥,此時,這個printf說:&quot;是我大哥&quot;,跟計算機說明白了我跟誰混,計算機和他大哥熟悉啊,知道它大哥是什么貨色能干什么,一看是它小弟,哦懂了,你讓我打印這個東西,讀到\n時,換到下一行,執行下個命令。它是整個C語言程序的入口,就好比說我們要進入某個地方,就一定得找到大門,計算機必須識別到main,才能夠執行我們給它發出的指令。\n-->計算機識別到它,就會換行,是一個指令,在此沒有多余的意思。_hello world">
      <link rel="stylesheet" type="text/css" >
  <style>
      #content_views pre{
          -webkit-touch-callout: none;
          -webkit-user-select: none;
          -khtml-user-select: none;
          -moz-user-select: none;
          -ms-user-select: none;
          user-select: none;
      }
      #content_views pre code{
          -webkit-touch-callout: none;
          -webkit-user-select: none;
          -khtml-user-select: none;
          -moz-user-select: none;
          -ms-user-select: none;
          user-select: none;
      }
  </style>
  ......網頁整體部分省略

3. 使用ScrapingBee 網絡抓取平臺API搭建應用的其他關鍵考慮因素

在使用ScrapingBee 網絡抓取平臺API搭建應用時,除了獲取和測試API密鑰外,還需考慮以下因素:

身份驗證

您必須對本頁上的所有 API 請求進行身份驗證。您可以使用您的 API 令牌進行身份驗證:

名稱必填類型說明
api_keystring在儀表盤→ 您的API密鑰中查看

常見狀態碼

狀態碼是否計費含義建議操作 / 解決方案
200? 是調用成功請求成功,無需操作。
400? 否錯誤請求參數錯誤或類型不正確,請檢查請求參數并參考響應體中的錯誤信息。
401? 否無剩余額度當前賬戶額度不足,請升級計劃或聯系銷售支持。
404? 是請求的 URL 未找到提供有效的 URL。
410? 是請求的 URL 已刪除提供有效的 URL。
413? 否文件過大上傳較小的文件或分塊處理。
429? 否并發請求過多當前請求過多,請升級計劃或聯系銷售支持。
500? 否服務器錯誤請重試請求,并參考響應體中的錯誤信息。

4. ScrapingBee 網絡抓取平臺 API密鑰申請和使用中的常見問題

在申請和使用 ScrapingBee 網絡抓取平臺 API密鑰過程中,你可能會遇到以下常見問題:

ScrapingBee 的 API 有多快?如果一個網站難以抓取怎么辦? ScrapingBee 的 API 經過優化,即使面對復雜或受保護的網站也能快速響應。如果其他抓取工具在遇到反爬蟲措施的網站時遇到困難,ScrapingBee 則被設計成能夠高效應對這些挑戰,確保可靠的數據獲取。

如果請求失敗了會發生什么? 我們只按成功的請求收費,即返回200或404狀態碼。

我可以隨時取消我的計劃嗎? 是的,你可以隨時取消訂閱計劃。在你的儀表盤中,這可以在不到30秒內完成。

怎么在要抓取的頁面上滾動或點擊某個按鈕? 你可以通過使用我們的 js_scenario 參數 傳遞任何需要執行的 JavaScript 代碼片段。

5. ScrapingBee 網絡抓取平臺 API進階指引

在獲得ScrapingBee 網絡抓取平臺 API密鑰之后,即可開啟API接口對接,本文整理了多篇使用ScrapingBee 網絡抓取平臺 API的案例,幫助讀者更有效地使用ScrapingBee 網絡抓取平臺 API:

阻止圖片和 CSS下載圖片和文件CSS /XPATH 數據提取JavaScript 執行地理位置定位

6. 常見問題

問題1: 什么是冪簡集成平臺?

冪簡集成是蜜堂有信在2023年打造的一款SAAS產品,建設著國內最全的API平臺,為開發者提供全面、高效、易用的API集成管理方案,一站搜索、試用、集成國內和國外API。讓用戶在AI時代全方位接入互聯網,用API連接一切服務和算力,實現價值倍增。

問題2:如何找到ScrapingBee 網絡抓取平臺 API

冪簡API平臺可以通過以下兩種方式找到所需API:通過關鍵詞搜索API(例如,輸入’ScrapingBee 網絡抓取平臺 API‘這類品類詞,更容易找到結果)、或者從API hub分類頁進入尋找。

問題3:ScrapingBee 網絡抓取平臺 API的替代品有哪些?

市場上存在免費、付費兩種替代者

例如

scraping-SERP抓取、千瓦跟蹤、千瓦分析、領英抓取由和為專業人士

NioLeads-LinkedIn數據抓取和前景列表建設

3idatascraping-網頁抓取服務

Scrapestack-免費代理和網絡抓取API

Web Scraping Service-專業網絡爬取服務

更多競品可以在ScrapingBee 網絡抓取平臺找到。

7. 總結

本文系統介紹了如何獲取和使用ScrapingBee網絡抓取平臺API密鑰,包括從申請密鑰、進行可用性測試,到在實際應用中考慮身份驗證、常見狀態碼處理及高級功能使用等各個環節。同時,文章還提供了常見問題解答和相關替代方案的參考,幫助開發者更高效、可靠地集成ScrapingBee的網頁抓取功能,實現數據采集與應用開發的順利開展。

上一篇:

Speechify 文本轉語音 API 快速入門文檔

下一篇:

使用 FastAPI、Docker 和 Hugging Face Transformers 的文本分類 API
#你可能也喜歡這些API文章!

我們有何不同?

API服務商零注冊

多API并行試用

數據驅動選型,提升決策效率

查看全部API→
??

熱門場景實測,選對API

#AI文本生成大模型API

對比大模型API的內容創意新穎性、情感共鳴力、商業轉化潛力

25個渠道
一鍵對比試用API 限時免費

#AI深度推理大模型API

對比大模型API的邏輯推理準確性、分析深度、可視化建議合理性

10個渠道
一鍵對比試用API 限時免費