BeautifulSoup Scraper
No credit card required
BeautifulSoup Scraper
No credit card required
Crawls websites using raw HTTP requests. It parses the HTML with the BeautifulSoup library and extracts data from the pages using Python code. Supports both recursive crawling and lists of URLs. This Actor is a Python alternative to Cheerio Scraper.
Do you want to learn more about this Actor?
Get a demoYou can access the BeautifulSoup Scraper programmatically from your own applications by using the Apify API. You can choose the language preference from below. To use the Apify API, you’ll need an Apify account and your API token, found in Integrations settings in Apify Console.
1echo '{
2 "startUrls": [
3 {
4 "url": "https://crawlee.dev"
5 }
6 ],
7 "maxCrawlingDepth": 1,
8 "requestTimeout": 10,
9 "linkSelector": "a[href]",
10 "linkPatterns": [
11 ".*crawlee\\\\.dev.*"
12 ],
13 "pageFunction": "from typing import Any\\n\\n# See the context section in readme to find out what fields you can access \\n# https://apify.com/vdusek/beautifulsoup-scraper#context \\ndef page_function(context: Context) -> Any:\\n url = context.request['\''url'\'']\\n title = context.soup.title.string if context.soup.title else None\\n return {'\''url'\'': url, '\''title'\'': title}\\n",
14 "soupFeatures": "html.parser",
15 "proxyConfiguration": {
16 "useApifyProxy": true
17 }
18}' |
19apify call apify/beautifulsoup-scraper --silent --output-dataset
BeautifulSoup Scraper API through CLI
The Apify CLI is the official tool that allows you to use BeautifulSoup Scraper locally, providing convenience functions and automatic retries on errors.
Install the Apify CLI
1npm i -g apify-cli
2apify login
Other API clients include:
Actor Metrics
17 monthly users
-
4 stars
99% runs succeeded
Created in Jul 2023
Modified a month ago