Example Php

Example Php

Example act using PHP as the main language.

DEVELOPER_TOOLSOPEN_SOURCEApify

This is simple example how to use PHP in Apify. It uses custom Dockerfile based on php:7.0-cli image.

Dockerfile

1FROM php:7.0-cli
2
3COPY ./* ./
4
5CMD [ "php", "./main.php" ]

main.php

1<?php
2print "Starting ...\n";
3print "ENV vars:\n";
4print_r($_ENV);
5print "Fetching http://example.com ...\n";
6$exampleComHtml = file_get_contents('http://example.com');
7print "Searching for <h1> tag contents ...\n";
8preg_match_all('/<h1>(.*?)<\/h1>/', $exampleComHtml, $matches);
9print "Found: " . $matches[1][0] . "\n";
10print "I am done!\n";

Frequently Asked Questions

Is it legal to scrape job listings or public data?

Yes, if you're scraping publicly available data for personal or internal use. Always review Websute's Terms of Service before large-scale use or redistribution.

Do I need to code to use this scraper?

No. This is a no-code tool — just enter a job title, location, and run the scraper directly from your dashboard or Apify actor page.

What data does it extract?

It extracts job titles, companies, salaries (if available), descriptions, locations, and post dates. You can export all of it to Excel or JSON.

Can I scrape multiple pages or filter by location?

Yes, you can scrape multiple pages and refine by job title, location, keyword, or more depending on the input settings you use.

How do I get started?

You can use the Try Now button on this page to go to the scraper. You’ll be guided to input a search term and get structured results. No setup needed!