You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Use Crawlee to find rating of the most popular Netflix films
499
+
500
+
The [Global Top 10](https://www.netflix.com/tudum/top10) page contains a table of the most currently popular Netflix films worldwide. Scrape the movie names, then search for each movie at the [IMDb](https://www.imdb.com/). Assume the first search result is correct and find out what's the film's rating. Each item you push to the Crawlee's default dataset should contain the following data:
501
+
502
+
- URL of the film's imdb.com page
503
+
- Title
504
+
- Rating
505
+
506
+
If you export the dataset as a JSON, you should see something like this:
For each name from the Global Top 10, you'll need to construct a `Request` object with IMDb search URL. Take the following code snippet as a hint on how to do it:
When following the first search result, you may find handy to know that `context.enqueue_links()` takes a `limit` keyword argument, where you can specify the max number of HTTP requests to enqueue.
548
+
549
+
<details>
550
+
<summary>Solution</summary>
551
+
552
+
```py
553
+
import asyncio
554
+
from urllib.parse import quote_plus
555
+
556
+
from crawlee import Request
557
+
from crawlee.beautifulsoup_crawler import BeautifulSoupCrawler
558
+
559
+
asyncdefmain():
560
+
crawler = BeautifulSoupCrawler()
561
+
562
+
@crawler.router.default_handler
563
+
asyncdefhandle_netflix_table(context):
564
+
requests = []
565
+
for name_cell in context.soup.select(".list-tbl-global .tbl-cell-name"):
0 commit comments