VOOZH about

URL: https://apify.com/haskell/apify-project-01

โ‡ฑ Apify Project 01 ยท Apify


Pricing

Pay per usage

Go to Apify Store

Pricing

Pay per usage

Rating

0.0

(0)

Developer

๐Ÿ‘ Carlos Sanchez

Carlos Sanchez

Maintained by Community

Actor stats

0

Bookmarked

4

Total users

0

Monthly active users

2 years ago

Last modified

Share

BeautifulSoup and HTTPX template

A template for web scraping data from websites enqueued from starting URL using Python. The URL of the web page is passed in via input, which is defined by the input schema. The template uses the HTTPX to get the HTML of the page and the Beautiful Soup to parse the data from it. Enqueued URLs are available in request queue. The data are then stored in a dataset where you can easily access them.

Included features

  • Apify SDK for Python - a toolkit for building Apify Actors and scrapers in Python
  • Input schema - define and easily validate a schema for your Actor's input
  • Request queue - queues into which you can put the URLs you want to scrape
  • Dataset - store structured data where each object stored has the same attributes
  • HTTPX - library for making asynchronous HTTP requests in Python
  • Beautiful Soup - a Python library for pulling data out of HTML and XML files

How it works

This code is a Python script that uses HTTPX and Beautiful Soup to scrape web pages and extract data from them. Here's a brief overview of how it works:

  • The script reads the input data from the Actor instance, which is expected to contain a start_urls key with a list of URLs to scrape and a max_depth key with the maximum depth of nested links to follow.
  • The script enqueues the starting URLs in the default request queue and sets their depth to 0.
  • The script processes the requests in the queue one by one, fetching the URL using HTTPX and parsing it using BeautifulSoup.
  • If the depth of the current request is less than the maximum depth, the script looks for nested links in the page and enqueues their targets in the request queue with an incremented depth.
  • The script extracts the desired data from the page (in this case, all the links) and pushes it to the default dataset using the push_data method of the Actor instance.
  • The script catches any exceptions that occur during the scraping process and logs an error message using the Actor.log.exception method.
  • This code demonstrates how to use Python and the Apify SDK to scrape web pages and extract specific data from them.

Resources

Getting started

For complete information see this article. To run the actor use the following command:

$apify run

Deploy to Apify

Connect Git repository to Apify

If you've created a Git repository for the project, you can easily connect to Apify:

  1. Go to Actor creation page
  2. Click on Link Git Repository button

Push project on your local machine to Apify

You can also deploy the project on your local machine to Apify without the need for the Git repository.

  1. Log in to Apify. You will need to provide your Apify API Token to complete this action.

    $apify login
  2. Deploy your Actor. This command will deploy and build the Actor on the Apify Platform. You can find your newly created Actor under Actors -> My Actors.

    $apify push

Documentation reference

To learn more about Apify and Actors, take a look at the following resources:

You might also like

Freelancer Projects Scraper

scrapeai/freelancer-projects-scraper

Extract project listings from Freelancer.com, including job titles, project descriptions, minimum and maximum budgets, required skills, bid statistics, and project URLs.

Freelancer Scraper

jungle_synthesizer/freelancer-scraper

Scrape Freelancer project listings by keyword search or skill category. Extract project title, description, budget, bid count, days left, required skills, and project URL โ€” no account or API key required.

๐Ÿ‘ User avatar

BowTiedRaccoon

2

Indiegogo Project Search Scraper

stealth_mode/indiegogo-project-search-scraper

Scrape thousands of Indiegogo project listings from search results. Extract campaign goals, backer counts, funding status, creator info, and 40+ fields per project โ€” perfect for market research, investment analysis, and trend monitoring.

Kickstarter Project Search Scraper

stealth_mode/kickstarter-project-search-scraper

Scrape Kickstarter project listings with complete campaign data. Collect 40+ fields including funding goals, pledged amounts, backer counts, creator info, and project metadata โ€” perfect for market research, investment analysis, and competitive intelligence.

Freelancer.com Project Scraper

moving_beacon-owner1/freelancer-com-project-scraper

Scrape active Freelancer.com projects by keyword, budget, and type. Gather project details like title, budget, bids, skills, description, status, and URL. Supports pagination, budget filtering, curl_cffi browser impersonation, and optional Apify proxy for large-scale project discovery.

2

Freelancer Scraper

crawlerbros/freelancer-scraper

Scrape Freelancer project pages from direct URLs, Freelancer search queries, or job category URLs. Extract project title, budget or hourly rate, bid counts, days left, skills, and project descriptions.