Get your API key

Lesson 3 mein se 5

Agent ke saath ek chhota, polite scraper banao

Polite collecting ke chhe rules, ek Prompt Card jisse agent safe scraper likhe, aur site mana kare toh kya karein.

9 min Login karke kholo

Yeh course seekhne ke liye general jaankari hai, legal advice nahi. Ikattha kiye data ke business use ke liye kisi lawyer se poochho.

Ek baar mein ek step, page palatne jaisa.

Is lesson ke end tak aapka AI agent ek chhota, polite scraper likh chuka hoga jo ek practice site se 60 books CSV mein ikattha karta hai, aur aap jaan jaoge ki uska code kaise check karna hai aur site mana kare toh kya karna hai.

Aapko chahiye: ek coding agent, Python 3 aur ek terminal (naya hai toh Open a terminal dekho) · Time: 9 minute

  1. Hum books.toscrape.com pe practice karenge, ek banayi hui bookstore jo scraping seekhne walon ke liye bani hai. Iske banane wale ise beginners ke liye safe jagah kehte hain, toh seekhte waqt kisi asli dukaan ko pareshaan nahi karoge.

    Aapka agent code Python mein likhega, do add-on packages ke saath:

    • requests web page download karta hai, bina screen wale browser ki tarah.
    • Beautiful Soup (package ka naam beautifulsoup4) page ke HTML ke andar cheezein dhoondhta hai, jaise "har book ka title".

    Python check karo aur dono install karo. Mac ya Linux pe:

    Terminal · macOS / Linux
    python3 --version
    python3 -m pip install requests beautifulsoup4

    Windows pe:

    PowerShell · Windows
    py --version
    py -m pip install requests beautifulsoup4
    Kyun?

    Scraping ke liye bani site pe practice karne ka matlab hai aapki galtiyon (bahut tez, galat pages, loop) ka kisi pe koi nuksaan nahi. Aadatein pehle seekho, safe target pe.

Baaki lesson padhne ke liye free login karo

Har lesson free hai. Free account se saare lessons khul jaate hain aur aapki progress save hoti hai.

Is lesson mein aage:

  1. Polite scraper ke chhe rules
  2. Aapke scraper ka Prompt Card
  3. Chalane se pehle code padho
  4. Chalao aur result check karo
  5. Jab site mana kare
  6. Recap