Skip to content

AttributeError: 'KeyValueStore' object has no attribute 'get_public_url' #285

@pawel-krzych

Description

@pawel-krzych

In the SDK documentation we can find that:

Public URLs of records
To get a publicly accessible URL of a key-value store record, you can use the KeyValueStore.get_public_url() method.

print(f'"my_record" record URL: {await store.get_public_url('my_record')}')

but there is an error:

AttributeError: 'KeyValueStore' object has no attribute 'get_public_url'

Sample code that generates an error:

page = await context.new_page()
await page.goto(url)

screenshot = await page.screenshot(full_page=True)

key_value_store = await Actor.open_key_value_store()
screenshot_key = f"screenshot_{request.id}.png"
await key_value_store.set_value(
    screenshot_key,
    screenshot,
    content_type="image/png",
)

screenshot_url = await key_value_store.get_public_url(
    screenshot_key
)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working.t-toolingIssues 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