Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Handle request list and proxy configuration inputs in a user-friendly way #310

Copy link
Copy link

Description

@janbuchar
Issue body actions

An actor.json like this:

{
    "actorSpecification": 1,
    "name": "example-actor",
    "version": "0.0",
    "buildTag": "latest",
    "environmentVariables": {},
    "input": {
        "properties": {
            "startUrls": {
                "title": "Start URLs",
                "type": "array",
                "description": "URLs to start with",
                "prefill": [
                    {
                        "url": "https://apify.com"
                    }
                ],
                "editor": "requestListSources"
            },
            "proxyConfiguration": {
                "title": "Proxy configuration",
                "type": "object",
                "description": "Select proxies to be used by your crawler.",
                "prefill": {
                    "useApifyProxy": true
                },
                "editor": "proxy"
            }
        }
    }
}

will have an input editor like this:

image

and calling Actor.get_input() in the actor will result into something like this:

{
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["BUYPROXIES63811", "SHADER"],
    },
    "startUrls": [
        {"url": "https://google.com", "method": "GET"},
        {"url": "https://salas.hu", "method": "GET"},
        {"url": "https://trivago.hu", "method": "GET"},
        {"requestsFromUrl": "https://lorem.se/ipsum.txt", "method": "GET"},
    ],
}

It would be awesome if we could implement some helpers to simplify converting these structures into crawlee.storage.RequestList or apify.ProxyConfiguration.

Since it is pretty convenient to have the input structure described with a Pydantic model (so you can do Input.model_validate(await Actor.get_input()), I would love to explore the possibility of adding some Pydantic models that you could use in your Input models and then pass them to ProxyConfiguration or RequestList constructors (or some factory methods).

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request.New feature or request.t-toolingIssues with this label are in the ownership of the tooling team.Issues with this label are in the ownership of the tooling team.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

Morty Proxy This is a proxified and sanitized view of the page, visit original site.