1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "sourceMode": "list",
12 "researchBrief": "Beginner-friendly Python web scraping tutorials (requests, BeautifulSoup, Scrapy, Playwright) that teach a complete project step by step",
13 "searchQueries": [
14 "python web scraping tutorial",
15 "beautifulsoup tutorial",
16 "scrapy tutorial for beginners"
17 ],
18 "maxResultsPerQuery": 30,
19 "maxDiscoveryChargeUsd": 0.5,
20 "discoveryInput": {},
21 "proxyConfiguration": {
22 "useApifyProxy": false
23 },
24 "itemsList": [
25 {
26 "id": "k3Vq9TzP1aE",
27 "title": "Web Scraping with Python - BeautifulSoup Tutorial for Beginners",
28 "url": "https://www.youtube.com/watch?v=k3Vq9TzP1aE",
29 "thumbnailUrl": "https://i.ytimg.com/vi/k3Vq9TzP1aE/maxresdefault.jpg",
30 "viewCount": 312450,
31 "date": "8 months ago",
32 "likes": 9870,
33 "commentsCount": 412,
34 "duration": "24:18",
35 "channelName": "Code with Mira",
36 "channelUrl": "https://www.youtube.com/@codewithmira",
37 "numberOfSubscribers": 48200,
38 "channelTotalVideos": 96,
39 "channelLocation": "Canada",
40 "isMonetized": true,
41 "commentsTurnedOff": false,
42 "fromYTUrl": "https://www.youtube.com/results?search_query=python+web+scraping+tutorial",
43 "text": "Learn web scraping with Python from zero: we download a page with requests, parse it with BeautifulSoup and save the results to CSV. Perfect if you have never scraped a website before.\n\n00:00 Intro\n01:12 Installing requests and BeautifulSoup\n05:40 Finding elements with CSS selectors\n14:05 Handling pagination\n21:30 Saving to CSV\n\n#python #webscraping #beautifulsoup",
44 "subtitles": [
45 {
46 "language": "en",
47 "type": "auto_generated",
48 "srt": "1\n00:00:01,000 --> 00:00:04,500\nin this video we build a web scraper in Python from scratch\n\n2\n00:01:12,000 --> 00:01:16,000\nfirst install requests and BeautifulSoup with pip\n\n3\n00:05:40,000 --> 00:05:45,000\nBeautifulSoup lets you find elements with CSS selectors\n\n4\n00:14:05,000 --> 00:14:09,000\nto handle pagination we follow the next page link in a loop\n\n5\n00:21:30,000 --> 00:21:35,000\nfinally we write every product row to a CSV file"
49 }
50 ]
51 },
52 {
53 "id": "Rw8nD2xYp4Q",
54 "title": "Build a Price Tracker in Python (requests + BeautifulSoup) - Full Project",
55 "url": "https://www.youtube.com/watch?v=Rw8nD2xYp4Q&list=PLx9sampleplaylist&index=3",
56 "viewCount": 41700,
57 "date": "3 weeks ago",
58 "likes": 2150,
59 "commentsCount": 133,
60 "duration": "38:05",
61 "channelName": "Byte Sized Dev",
62 "channelUrl": "https://www.youtube.com/@bytesizeddev",
63 "numberOfSubscribers": 8900,
64 "channelTotalVideos": 41,
65 "fromYTUrl": "https://www.youtube.com/results?search_query=python+web+scraping+tutorial",
66 "text": "A complete beginner project: a Python price tracker that checks a product page every day and emails you when the price drops. Step by step with requests, BeautifulSoup and a scheduler.\n\n00:00 What we build\n03:20 Scraping the price\n17:45 Storing history\n29:10 Email alerts",
67 "subtitles": [
68 {
69 "language": "en",
70 "type": "auto_generated",
71 "srt": "today we build a complete price tracker project step by step\nwe fetch the product page with requests\nthen BeautifulSoup pulls the price out of the HTML\nwe store every price in a small SQLite table\nand send an email when the price drops below your target"
72 }
73 ]
74 },
75 {
76 "id": "Tq4LmZ8sV0c",
77 "title": "Scrapy vs Playwright vs BeautifulSoup: which Python scraper should you use?",
78 "url": "https://www.youtube.com/watch?v=Tq4LmZ8sV0c",
79 "viewCount": 88300,
80 "date": "2026-07-02",
81 "likes": 3410,
82 "commentsCount": 198,
83 "duration": "16:42",
84 "channelName": "DataLane",
85 "channelUrl": "https://www.youtube.com/@datalane",
86 "numberOfSubscribers": 126000,
87 "channelTotalVideos": 212,
88 "fromYTUrl": "https://www.youtube.com/results?search_query=beautifulsoup+tutorial",
89 "text": "Three Python scraping tools compared on the same site: speed, JavaScript support and how much code each needs. Which one should a beginner learn first?"
90 },
91 {
92 "id": "Hy7cXe2KkPs",
93 "title": "Playwright Python Tutorial: Scrape JavaScript Websites",
94 "url": "https://www.youtube.com/watch?v=Hy7cXe2KkPs",
95 "viewCount": 57900,
96 "date": "5 months ago",
97 "likes": 1890,
98 "commentsCount": 76,
99 "duration": "19:57",
100 "channelName": "Automate Everything",
101 "channelUrl": "https://www.youtube.com/@automateeverything",
102 "numberOfSubscribers": 212000,
103 "channelTotalVideos": 318,
104 "fromYTUrl": "https://www.youtube.com/results?search_query=beautifulsoup+tutorial",
105 "text": "When requests and BeautifulSoup return an empty page, the site renders with JavaScript. This tutorial shows how Playwright for Python opens a real browser, waits for the content and extracts it."
106 },
107 {
108 "id": "Lf0BeatsM1x",
109 "title": "lofi beats to code to - 3 hour mix",
110 "url": "https://www.youtube.com/watch?v=Lf0BeatsM1x",
111 "viewCount": 902000,
112 "date": "1 year ago",
113 "likes": 21400,
114 "commentsCount": 640,
115 "duration": "3:02:11",
116 "channelName": "Chill Hours",
117 "channelUrl": "https://www.youtube.com/@chillhours",
118 "numberOfSubscribers": 1450000,
119 "fromYTUrl": "https://www.youtube.com/results?search_query=python+web+scraping+tutorial",
120 "text": "Three hours of calm lofi beats for coding and studying."
121 },
122 {
123 "id": "Sh0rtPy1lnR",
124 "title": "One-line Python scraper #shorts",
125 "url": "https://www.youtube.com/shorts/Sh0rtPy1lnR",
126 "viewCount": 120500,
127 "date": "2 weeks ago",
128 "likes": 6100,
129 "duration": "0:45",
130 "channelName": "Byte Sized Dev",
131 "numberOfSubscribers": 8900,
132 "fromYTUrl": "https://www.youtube.com/results?search_query=python+web+scraping+tutorial"
133 },
134 {
135 "url": "https://www.youtube.com/watch?v=Xx0Unavail1",
136 "input": "https://www.youtube.com/watch?v=Xx0Unavail1",
137 "error": "VIDEO_UNAVAILABLE",
138 "note": "Video unavailable"
139 }
140 ]
141};
142
143
144const run = await client.actor("rich_minds/youtube-video-research-ai").call(input);
145
146
147console.log('Results from dataset');
148console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
149const { items } = await client.dataset(run.defaultDatasetId).listItems();
150items.forEach((item) => {
151 console.dir(item);
152});
153
154