#How to input specific URLs?

1 messages · Page 1 of 1 (latest)

cobalt meteor
#

I would like to add an input to my actor as such:

How can I do this best in the Apify input schema and how can I extract these URL strings in Typescript code?

The below approach unfortunately does not work:

interface InputSchema {
  companyWebsites: string[];
  sortBy: string;
  filterByStarRating: string;
  filterBylanguage: string;
  filterByVerified: string;
  startFromPageNumber: number;
  endAtPageNumber: number;
}
const input = await Actor.getInput<InputSchema>();
let companyWebsites: string[] | undefined = input?.companyWebsites;
companyWebsites?.forEach(function (companyWebsite) {
  console.log(companyWebsite);
});
main matrix
cobalt meteor
#

thanks should StringList or Json be used for editor type?

#

the [object%20Object] should just be for example ebay.com

#

For example this:

const input = await Actor.getInput<InputSchema>();
let companyWebsites: string[] | undefined = input?.companyWebsites;

companyWebsites?.forEach(function (companyWebsite) {
  console.log("validating companyWebsites");
  console.log(companyWebsite);
});

Output this in console:

validating companyWebsites
{ url: 'trustpilot.com' }

#

I just need to output a simple sting, not an object as it does at the moment

cobalt meteor
#

@prime rock

buoyant tiger
#

Hey! Use: console.log(companyWebsite.url); . This probably happened because you used "editor": "requestListSources" in the input schema file.

cobalt meteor
#

@buoyant tiger Hi,

The schema looks like this so there is no url property:

interface InputSchema {
  companyWebsites: string[];
  sortBy: string;
  filterByStarRating: string;
  filterBylanguage: string;
  filterByVerified: string;
  startFromPageNumber: number;
  endAtPageNumber: number;
}

I have tried with "editor": "json" and it also fails.

Do you have other suggestions?

#

Is there some standard way of handling such a scenario where you need to input different uri/urls in this context?