LinkedIn Ads Scraper avatar

LinkedIn Ads Scraper

Try for free

1 day trial then $25.00/month - No credit card required now

Go to Store
LinkedIn Ads Scraper

LinkedIn Ads Scraper

silva95gustavo/linkedin-ad-library-scraper
Try for free

1 day trial then $25.00/month - No credit card required now

Extract ads of any format from LinkedIn Ad Library. Gain access to ad details, ad copy, media URL, call-to-action buttons and more. Dive deeper into the LinkedIn Ad Library for a competitive edge.

LO

I'm only getting 2 results

Closed
lonzchris opened this issue
a month ago

I looked at the company ads they have 43 ads but I'm only getting 2 results. Is there a way to fix this? because I'm trying to run this using a code so I have to use the given API endpoint (Python) code

silva95gustavo avatar

Hello @lonzchris,

Could you please let me know which URL you are using as input?

LO

lonzchris

a month ago

I saw the reason why I'm only getting 2 results is because I'm using the actor itself but I did had another issue tho so I saved the task and uses the API Client however the issue how can I change the startUrls if I want to scrape a different company because it always scrapes Palo Alto Network which is the default you put in. Am I able to configure the startUrls in the code it would be nice to be able to do that like have some inputs in the call function

1from apify_client import ApifyClient
2
3# Initialize the ApifyClient with your API token
4client = ApifyClient("<YOUR_API_TOKEN>")
5
6# Run the Actor task and wait for it to finish
7run = client.task("7MuIdym3B5x6duTQa").call()
8
9# Fetch and print Actor task results from the run's dataset (if there are any)
10for item in client.dataset(run["defaultDatasetId"]).iterate_items():
11    print(item)
silva95gustavo avatar

Currently the default example URL should refer to Niantic, Inc, as follows: https://adstransparency.google.com/advertiser/AR08888592736429539329?authuser=0&region=ES&preset-date=Last+30+days

How exactly are you seeing Palo Alto Network? Perhaps you are already changing the URL somewhere else?

In your Python code example, you would provide the input parameters to the call() method as arguments. See the documentation of call() here: https://docs.apify.com/api/client/python/docs#passing-input-to-the-actor

LO

lonzchris

a month ago

okay maybe I configured it in the Apify console itself, but that doesn't fix the problem.

because here's what I tried so far. You can correct me if I'm wong...

There are 2 ways to call the Apify Client

  • actor
  • task

so when I use the client.actor() tho I can configure the startUrls in the python code, but I keep getting only 2 outputs.

then I changed it to client.task() however I can scraped the total ads of the company however I cannot configured the startUrls in the python code.

silva95gustavo avatar

Perhaps the best way to troubleshoot your issue is for us to schedule a meeting, then I can check your specific problem and suggest a solution to your use case.

Please check the meeting link I shared with you externally.

Developer
Maintained by Community

Actor Metrics

  • 143 monthly users

  • 20 bookmarks

  • >99% runs succeeded

  • 1 days response time

  • Created in Oct 2023

  • Modified 10 days ago