github / github/dotnet-codespaces

test_brightdata.py

オープン
#71 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
HTML
スター
245
フォーク
321
PR マージ指標
30日以内にマージされた PR はありません

説明

import requests

API_KEY = "2aeaa6b4-7ba5-4d9a-8b80-e31caea98888"

ZONE = "web_unlocker1"

url = "https://api.brightdata.com/request"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
}

payload = {
"zone": ZONE,
"url": "https://creative.apple.com",
"format": "raw",

# Optional: location targeting
"country": "us",
"city": "seattle",
# "asn": 12345, # if you know the ASN and it is enabled for your zone
}

try:
response = requests.post(url, json=payload, headers=headers, timeout=60)
response.raise_for_status()
result = response.json()

print("Status code from target site:", result.get("status_code"))
print("First 500 characters of page:")
print(result.get("body", "")[:500])

except Exception as e:
print("Error:", e)

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず test_brightdata.py と https://api.brightdata.com/request への requests.post 呼び出しを確認してください。issue には何を変更すべきか、また完了をどのように検証すべきかが指定されていないため、編集する前に意図された動作を確認してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
api, backend
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
静か
明瞭さ
説明が足りない
初心者へのやさしさ
20/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。