1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "sourceMode": "list",
10 "researchBrief": "Beginner-friendly Python web scraping tutorials (requests, BeautifulSoup, Scrapy, Playwright) that teach a complete project step by step",
11 "searchQueries": [
12 "python web scraping tutorial",
13 "beautifulsoup tutorial",
14 "scrapy tutorial for beginners",
15 ],
16 "maxResultsPerQuery": 30,
17 "maxDiscoveryChargeUsd": 0.5,
18 "discoveryInput": {},
19 "proxyConfiguration": { "useApifyProxy": False },
20 "itemsList": [
21 {
22 "id": "k3Vq9TzP1aE",
23 "title": "Web Scraping with Python - BeautifulSoup Tutorial for Beginners",
24 "url": "https://www.youtube.com/watch?v=k3Vq9TzP1aE",
25 "thumbnailUrl": "https://i.ytimg.com/vi/k3Vq9TzP1aE/maxresdefault.jpg",
26 "viewCount": 312450,
27 "date": "8 months ago",
28 "likes": 9870,
29 "commentsCount": 412,
30 "duration": "24:18",
31 "channelName": "Code with Mira",
32 "channelUrl": "https://www.youtube.com/@codewithmira",
33 "numberOfSubscribers": 48200,
34 "channelTotalVideos": 96,
35 "channelLocation": "Canada",
36 "isMonetized": True,
37 "commentsTurnedOff": False,
38 "fromYTUrl": "https://www.youtube.com/results?search_query=python+web+scraping+tutorial",
39 "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.
40
4100:00 Intro
4201:12 Installing requests and BeautifulSoup
4305:40 Finding elements with CSS selectors
4414:05 Handling pagination
4521:30 Saving to CSV
46
47#python #webscraping #beautifulsoup""",
48 "subtitles": [{
49 "language": "en",
50 "type": "auto_generated",
51 "srt": """1
5200:00:01,000 --> 00:00:04,500
53in this video we build a web scraper in Python from scratch
54
552
5600:01:12,000 --> 00:01:16,000
57first install requests and BeautifulSoup with pip
58
593
6000:05:40,000 --> 00:05:45,000
61BeautifulSoup lets you find elements with CSS selectors
62
634
6400:14:05,000 --> 00:14:09,000
65to handle pagination we follow the next page link in a loop
66
675
6800:21:30,000 --> 00:21:35,000
69finally we write every product row to a CSV file""",
70 }],
71 },
72 {
73 "id": "Rw8nD2xYp4Q",
74 "title": "Build a Price Tracker in Python (requests + BeautifulSoup) - Full Project",
75 "url": "https://www.youtube.com/watch?v=Rw8nD2xYp4Q&list=PLx9sampleplaylist&index=3",
76 "viewCount": 41700,
77 "date": "3 weeks ago",
78 "likes": 2150,
79 "commentsCount": 133,
80 "duration": "38:05",
81 "channelName": "Byte Sized Dev",
82 "channelUrl": "https://www.youtube.com/@bytesizeddev",
83 "numberOfSubscribers": 8900,
84 "channelTotalVideos": 41,
85 "fromYTUrl": "https://www.youtube.com/results?search_query=python+web+scraping+tutorial",
86 "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.
87
8800:00 What we build
8903:20 Scraping the price
9017:45 Storing history
9129:10 Email alerts""",
92 "subtitles": [{
93 "language": "en",
94 "type": "auto_generated",
95 "srt": """today we build a complete price tracker project step by step
96we fetch the product page with requests
97then BeautifulSoup pulls the price out of the HTML
98we store every price in a small SQLite table
99and send an email when the price drops below your target""",
100 }],
101 },
102 {
103 "id": "Tq4LmZ8sV0c",
104 "title": "Scrapy vs Playwright vs BeautifulSoup: which Python scraper should you use?",
105 "url": "https://www.youtube.com/watch?v=Tq4LmZ8sV0c",
106 "viewCount": 88300,
107 "date": "2026-07-02",
108 "likes": 3410,
109 "commentsCount": 198,
110 "duration": "16:42",
111 "channelName": "DataLane",
112 "channelUrl": "https://www.youtube.com/@datalane",
113 "numberOfSubscribers": 126000,
114 "channelTotalVideos": 212,
115 "fromYTUrl": "https://www.youtube.com/results?search_query=beautifulsoup+tutorial",
116 "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?",
117 },
118 {
119 "id": "Hy7cXe2KkPs",
120 "title": "Playwright Python Tutorial: Scrape JavaScript Websites",
121 "url": "https://www.youtube.com/watch?v=Hy7cXe2KkPs",
122 "viewCount": 57900,
123 "date": "5 months ago",
124 "likes": 1890,
125 "commentsCount": 76,
126 "duration": "19:57",
127 "channelName": "Automate Everything",
128 "channelUrl": "https://www.youtube.com/@automateeverything",
129 "numberOfSubscribers": 212000,
130 "channelTotalVideos": 318,
131 "fromYTUrl": "https://www.youtube.com/results?search_query=beautifulsoup+tutorial",
132 "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.",
133 },
134 {
135 "id": "Lf0BeatsM1x",
136 "title": "lofi beats to code to - 3 hour mix",
137 "url": "https://www.youtube.com/watch?v=Lf0BeatsM1x",
138 "viewCount": 902000,
139 "date": "1 year ago",
140 "likes": 21400,
141 "commentsCount": 640,
142 "duration": "3:02:11",
143 "channelName": "Chill Hours",
144 "channelUrl": "https://www.youtube.com/@chillhours",
145 "numberOfSubscribers": 1450000,
146 "fromYTUrl": "https://www.youtube.com/results?search_query=python+web+scraping+tutorial",
147 "text": "Three hours of calm lofi beats for coding and studying.",
148 },
149 {
150 "id": "Sh0rtPy1lnR",
151 "title": "One-line Python scraper #shorts",
152 "url": "https://www.youtube.com/shorts/Sh0rtPy1lnR",
153 "viewCount": 120500,
154 "date": "2 weeks ago",
155 "likes": 6100,
156 "duration": "0:45",
157 "channelName": "Byte Sized Dev",
158 "numberOfSubscribers": 8900,
159 "fromYTUrl": "https://www.youtube.com/results?search_query=python+web+scraping+tutorial",
160 },
161 {
162 "url": "https://www.youtube.com/watch?v=Xx0Unavail1",
163 "input": "https://www.youtube.com/watch?v=Xx0Unavail1",
164 "error": "VIDEO_UNAVAILABLE",
165 "note": "Video unavailable",
166 },
167 ],
168}
169
170
171run = client.actor("rich_minds/youtube-video-research-ai").call(run_input=run_input)
172
173
174print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
175for item in client.dataset(run.default_dataset_id).iterate_items():
176 print(item)
177
178