![My Actr testing 2 avatar](https://images.apifyusercontent.com/-mdiYg4bhiPWk7kMZ70umV8IHzEGEuuLlcsM1fm6zz4/rs:fill:250:250/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMuYW1hem9uYXdzLmNvbS9ZSkNuUzlxb2dpOVh4RGdMQi9YeWd0Snl4RVFpWG4zV2Vwcy1JTUdfNzYzNXNhLTA4LnBuZw.webp)
My Actr testing 2
Try for free
No credit card required
View all Actors![My Actr testing 2](https://images.apifyusercontent.com/-mdiYg4bhiPWk7kMZ70umV8IHzEGEuuLlcsM1fm6zz4/rs:fill:250:250/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMuYW1hem9uYXdzLmNvbS9ZSkNuUzlxb2dpOVh4RGdMQi9YeWd0Snl4RVFpWG4zV2Vwcy1JTUdfNzYzNXNhLTA4LnBuZw.webp)
![My Actr testing 2](https://images.apifyusercontent.com/-mdiYg4bhiPWk7kMZ70umV8IHzEGEuuLlcsM1fm6zz4/rs:fill:250:250/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMuYW1hem9uYXdzLmNvbS9ZSkNuUzlxb2dpOVh4RGdMQi9YeWd0Snl4RVFpWG4zV2Vwcy1JTUdfNzYzNXNhLTA4LnBuZw.webp)
My Actr testing 2
xrhibiyftd/my-actr-testing-2
Try for free
No credit card required
Crawls websites with the headless Chrome and Puppeteer library using a provided server-side Node.js code. This crawler is an alternative to apify/web-scraper that gives you finer control over the process. Supports both recursive crawling and list of URLs. Supports login to website.
The code examples below show how to run the Actor and get its results. To run the code, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token, which you can find under Settings > Integrations in Apify Console. Learn more
1from apify_client import ApifyClient
2
3# Initialize the ApifyClient with your Apify API token
4client = ApifyClient("<YOUR_API_TOKEN>")
5
6# Prepare the Actor input
7run_input = {
8 "startUrls": [{ "url": "https://crawlee.dev" }],
9 "globs": [{ "glob": "https://crawlee.dev/*/*" }],
10 "pseudoUrls": [],
11 "excludes": [{ "glob": "/**/*.{png,jpg,jpeg,pdf}" }],
12 "linkSelector": "a",
13 "pageFunction": """async function pageFunction(context) {
14 const { page, request, log } = context;
15 const title = await page.title();
16 log.info(`URL: ${request.url} TITLE: ${title}`);
17 return {
18 url: request.url,
19 title
20 };
21}""",
22 "proxyConfiguration": { "useApifyProxy": True },
23 "initialCookies": [],
24 "waitUntil": ["networkidle2"],
25 "preNavigationHooks": """// We need to return array of (possibly async) functions here.
26// The functions accept two arguments: the \"crawlingContext\" object
27// and \"gotoOptions\".
28[
29 async (crawlingContext, gotoOptions) => {
30 const { page } = crawlingContext;
31 // ...
32 },
33]""",
34 "postNavigationHooks": """// We need to return array of (possibly async) functions here.
35// The functions accept a single argument: the \"crawlingContext\" object.
36[
37 async (crawlingContext) => {
38 const { page } = crawlingContext;
39 // ...
40 },
41]""",
42 "customData": {},
43}
44
45# Run the Actor and wait for it to finish
46run = client.actor("xrhibiyftd/my-actr-testing-2").call(run_input=run_input)
47
48# Fetch and print Actor results from the run's dataset (if there are any)
49print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
50for item in client.dataset(run["defaultDatasetId"]).iterate_items():
51 print(item)
52
53# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start
Actor metrics
- 3 monthly users
- 1 star
- 100.0% runs succeeded
- Created in Jan 2024
- Modified 8 months ago
Categories