กลับมาจากงานปาร์ตี้หรืออีเวนต์ สิ่งที่เราอยากรู้คือ เพื่อน หรือคนพิเศษของเรา “ได้รู้จักคนใหม่บ้างไหม” และ “มีใครติดตามเราใหม่หรือเปล่า” แต่ Instagram ไม่มีหน้าที่ไล่ดูรายชื่อ Followers แบบค้นหาได้หรือเทียบกับครั้งก่อนให้
บทความนี้ ใช้ Prompt เดียว สั่ง Claude in Chrome เปิดหน้าโปรไฟล์ในเบราว์เซอร์ของเรา อ่านรายชื่อ Followers แล้วเก็บบันทึกทำเป็นตาราง HTML ที่ค้นหาได้
การดู Instagram Followers ของ User นั้น ๆ ต้องมีเงื่อนไขว่า Username นั้นต้องเป็น Public profile หรือถ้าเป็น Private profile เราต้องเป็นเพื่อนกับคน ๆ นั้น (เป็น Follower ของเขา)
ในตัวอย่างนี้ใช้ Claude แต่สามารถใช้วิธีเดียวกันนี้กับ AI Agent ตัวอื่นเช่น
- Claude: Claude in Chrome
- Gemini: Gemini in Chrome (ใน Chrome มีอยู่แล้ว)
- ChatGPT: ChatGPT in Chrome
สิ่งที่ต้องเตรียม
ต้องมีบัญชี Instagram ที่ Login ไว้ในเบราว์เซอร์ Chrome และ AI Agent ที่ควบคุมเบราว์เซอร์ได้ ใช้ได้ทั้งบน macOS และ Windows เพราะทำงานผ่านเบราว์เซอร์
ในตัวอย่างนี้ใช้ Claude แต่สามารถใช้วิธีเดียวกันนี้กับ AI Agent ตัวอื่น ได้เช่นกัน
| สิ่งที่ต้องมี | รายละเอียด |
|---|---|
| Google Chrome | เปิดแท็บ Instagram ที่ Login แล้ว ด้วยบัญชีของเราเอง (macOS หรือ Windows ก็ได้) |
| Claude | สมัครใช้งาน Claude ใน Pro Plan ขึ้นไป |
| Claude in Chrome | Claude ที่เชื่อมกับ Chrome (Claude in Chrome) ดาวน์โหลดได้จากที่นี่ ใช้งานได้ฟรี ทำให้ Claude เข้าถึง Browser ได้ |
| Username ที่ต้องการเก็บข้อมูล | โปรไฟล์ที่ต้องการดึงรายชื่อ Followers |
วิธีทำอย่างละเอียด
เตรียม Claude และเปิด Instagram
เปิด Chrome แล้ว Login Instagram ด้วยบัญชีของเรา เปิดหน้าโปรไฟล์ User ที่ต้องการดึงรายชื่อ จากนั้นเปิด Claude ที่เชื่อมกับ Chrome ได้และเริ่มบทสนทนาใหม่
- เปิด instagram.com ใน Chrome แล้ว Login ให้เรียบร้อย
- เปิดหน้าโปรไฟล์ของ User ที่ต้องการ
https://www.instagram.com/<USERNAME>/ - เปิด Claude แล้วตรวจว่าสามารถเชื่อมต่อกับ Chrome ได้เรียบร้อย
Prompt ให้ Claude ดึงรายชื่อ Instagram Followers ทั้งหมด
คัดลอก Prompt ด้านล่างไปวางใน Claude in Chrome แล้วแก้สองบรรทัดแรกใต้ Task คือ Target profile และ Update mode ครั้งแรกให้ใช้ NEW
## Task
Scrape the Followers list of the Instagram profile currently open in my browser tab, through the normal UI (no private APIs), then publish it as a searchable HTML artifact with a "Last updated" timestamp.
**Target profile:** <USERNAME> (e.g. john_doe)
**Update mode:** <NEW | UPDATE existing artifact URL: ...>
## Part 1: Scrape followers (via UI)
1. Check the current tab with the browser tools. If the profile is not open, navigate to https://www.instagram.com/<USERNAME>/. Do not open extra tabs unless needed.
2. Click the "followers" count so the Followers dialog opens. If I'm not logged in, stop and ask me to log in. Never enter credentials.
3. Using JavaScript in the page:
- Find the dialog (`div[role="dialog"]`) and its scrollable container (overflow auto/scroll and scrollHeight > clientHeight).
- Collect rows into a dictionary keyed by username: username comes from the `<a href="/username/">` link, and name is the second text line of the row (empty if the row shows a button text such as Follow/Following/Remove instead).
- Loop: scroll to the bottom, wait 1.2-1.5 s, collect again. Stop after 4-5 consecutive rounds with no new rows. If the loop times out, run it again (state is kept in `window`).
4. Record the follower count shown on the profile header. The list usually loads fewer accounts than that number (hidden, restricted or unreturned accounts). Report both numbers and do not pad the list.
5. Reading the data back: tool output truncates at about 1,500 characters. Print results in slices of about 40-60 rows (`Object.entries(...).slice(a,b)`) and cross-check the slice boundaries so no row is missed or duplicated. Verify the final count equals the dictionary size.
6. Profile URL = `https://www.instagram.com/<username>/`.
## Part 2: Build the HTML artifact
Load the `artifact-design` skill first, then write one self-contained HTML file and publish it with the Artifact tool.
- Title: "<Display Name> Followers" (a short name, no explainer). Put the explanation in the `description` parameter.
- Header: the target profile link, and **Last updated: <date and time, Asia/Bangkok>** generated from the actual scrape time.
- Stats: Shown / Collected / Listed on profile.
- Table columns: #, Username (link), Name, Profile URL (full URL as a link).
- Search box filtering by username or name, and a "Copy as CSV" button (clipboard, with a fallback message if it is blocked).
- A short note: the Instagram list loads fewer accounts than the profile count; an empty name means the account has no display name.
- Theme-aware (light and dark tokens), responsive at 400px with no horizontal page scroll, table inside an `overflow-x:auto` container, tabular-nums for digits.
- Build rows with DOM APIs (`textContent`), not `innerHTML`, since names contain emoji and special characters.
- For UPDATE mode: read the existing artifact first, then republish to the same URL and keep the title stable. Add a "Changes since last update" line (new followers and removed followers) by diffing usernames against the previous data.
## Rules
- Work inside the existing tab. Do not download files or send messages.
- Do not follow, unfollow, remove, or click any button in the dialog other than scrolling.
- If Instagram shows a login wall, challenge, rate limit, or "try again later" message, stop and tell me.
- Finish with 2-3 sentences: how many collected vs listed, and a link to the artifact. Do not paste the full list into chat unless I ask.อธิบายรายละเอียดของ Prompt ที่ควรเข้าใจก่อนใช้:
| ทำหน้าที่อะไร | |
|---|---|
| Part 1 | สั่งขั้นตอนอ่านรายชื่อผ่านหน้าจอ และบังคับให้รายงานจำนวนที่เก็บได้เทียบกับตัวเลขบนโปรไฟล์ |
| Part 2 | สั่งสร้างหน้า HTML ที่ค้นหาได้ รองรับ Dark Mode และมือถือ แล้ว Publish เป็น Artifact |
| Rules | กันความผิดพลาด: ห้ามกด Follow/Unfollow/Remove ห้ามดาวน์โหลดไฟล์ ห้ามส่งข้อความ และให้หยุดทันทีเมื่อเจอ Challenge |
| Update mode | NEW สร้างหน้าใหม่ ส่วน UPDATE existing artifact URL: ... ให้แก้หน้าเดิมและเทียบกับรอบก่อน |
ตรวจผลลัพธ์ที่ AI ทำงาน
เมื่อ Claude ทำเสร็จ จะสรุปสั้น ๆ ว่าเก็บได้กี่คนเทียบกับจำนวนบนโปรไฟล์ พร้อมลิงก์ Artifact ให้เปิดหน้านั้นแล้วตรวจสี่อย่างก่อนใช้งานต่อ
- ตัวเลข Collected ตรงกับจำนวนแถวในตารางหรือไม่ และ Listed on profile ตรงกับที่เห็นบน Instagram หรือไม่
- ลองค้นหา ชื่อหรือ Username ที่เรารู้ว่าตามเราอยู่ ว่าขึ้นในตารางหรือไม่
- ลองกดลิงก์ Username สัก 2–3 คน ว่าเปิดโปรไฟล์ที่ถูกต้อง
- ลองปุ่ม Copy as CSV วางลง Google Sheets หรือ Excel ดูว่าคอลัมน์ไม่เพี้ยน (ชื่อที่มี Emoji หรืออักขระพิเศษควรอ่านได้)
ถ้าจำนวนที่เก็บได้น้อยกว่าตัวเลขบนโปรไฟล์ เป็นเรื่องปกติ ดูสาเหตุในส่วนคำถามที่พบบ่อย ถ้าน้อยกว่ามากผิดปกติ ให้สั่ง Claude รันรอบเก็บข้อมูลใหม่อีกครั้ง
อัปเดตรอบถัดไปและดูคนที่เปลี่ยน
กลับมารันซ้ำหลังจากผ่านไปสักพัก เช่น หลังโพสต์ใหม่หรือหลังงานอีเวนต์ แล้วให้ AI เทียบกับรายชื่อรอบก่อน เพื่อดูว่ามี Followers ใหม่และหายไปกี่คน
- เปิดบทสนทนาใหม่ใน Claude และเปิดแท็บ Instagram ที่ Login แล้วเหมือนขั้นที่ 1
- ใช้ Prompt เดิม แต่เปลี่ยนบรรทัด Update mode เป็น
**Update mode:** UPDATE existing artifact URL: <ลิงก์ Artifact รอบก่อน>- Claude จะอ่าน Artifact เดิมก่อน แล้ว Publish ทับลิงก์เดิม โดยคงชื่อไว้ และเพิ่มบรรทัด Changes since last update บอก Followers ใหม่และที่หายไป จากการเทียบ Username
- เช็กเวลา Last updated ว่าเปลี่ยนเป็นเวลาล่าสุดแล้ว
เนื่องจากเทียบกันด้วย Username ถ้าใครเปลี่ยน Username ระหว่างรอบ จะถูกนับเป็นคนหายไปหนึ่งคนและคนใหม่หนึ่งคน
ไอเดียต่อยอด
ไอเดียด้านล่างยังไม่ได้อยู่ใน Prompt ปัจจุบัน เป็นทิศทางที่ต่อยอดได้ โดยแก้ Prompt เพิ่มเติมแล้วสั่ง Claude ได้เลย
ดึงรายชื่อ Following ด้วย แล้วเทียบว่าใครตามเรากลับและใครไม่ตามกลับ
- เก็บประวัติแต่ละรอบ ให้ Artifact เก็บ Timeline ว่าแต่ละวันมี Followers ใหม่เท่าไร
- ทำป้ายกำกับคนที่เจอในงานอีเวนต์ เพิ่มคอลัมน์โน้ตเองสำหรับคนที่รู้จักใหม่
- วิเคราะห์ช่วงเวลาที่ Followers เพิ่มขึ้น เทียบกับวันที่โพสต์ Content
- ตั้งเตือนให้รันซ้ำ เช่น ทุกสัปดาห์ แล้วสั่ง Claude ทำตาม Prompt อัปเดต
คำถามที่พบบ่อย
Instagram โหลดบัญชีเข้ารายการน้อยกว่าตัวเลขที่แสดง เช่น บัญชีที่ซ่อน ถูกจำกัด หรือไม่ถูกส่งมา Prompt จึงสั่งให้รายงานทั้งสองตัวเลขและไม่เติมรายชื่อเอง หน้า Artifact มีโน้ตอธิบายเรื่องนี้ไว้ด้วย
Login Instagram เองในแท็บนั้นให้เรียบร้อย แล้วสั่ง Claude ให้ทำต่อ Prompt สั่งไว้ว่า Claude ต้องไม่กรอกรหัสผ่านให้
ตามกฎใน Prompt Claude จะหยุดและแจ้งเรา ให้รอสักพักแล้วค่อยลองใหม่ ไม่ควรรันซ้ำทันที
ค่าเริ่มต้น Artifact เป็นส่วนตัวของเรา แต่ถ้ากดแชร์ลิงก์ ใครได้ลิงก์ก็เห็นรายชื่อ Followers ทั้งหมด จึงไม่ควรแชร์ ถ้าไม่ต้องการเก็บอีกแล้ว ให้ลบ Artifact นั้นทิ้ง
ได้ ทั้ง macOS และ Windows ขอแค่มี Chrome ที่ Login Instagram ไว้ และ Claude เชื่อมกับ Chrome ได้ เพราะทั้งหมดทำงานผ่านเบราว์เซอร์ ไม่มีคำสั่ง Terminal
ถ้าไม่ทำงาน ให้บอก Claude ว่าเก็บไม่ได้ตรงไหน แล้วให้ตรวจโครงหน้าใหม่และปรับวิธีเก็บข้อมูล
