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

[DomCrawler] Support images like links #12429

Copy link
Copy link
Closed
@valeriangalliat

Description

@valeriangalliat
Issue body actions

I once needed to find an image and compute its full URI like Symfony\Component\DomCrawler\Link::getUri is doing, but unfortunately an img element is not accepted by the Link::setNode (thus calling Crawler::link on an img element is failing.

I have extended the Crawler class to provide an image function just like the link function, but returning an Image object (a new class extending Link, but overriding setNode to accept img elements), so I can use getUri to compute a full image src URI.

I was wondering if this feature may interest other people, and maybe be merged in this repo?

If so, do you think the image method with its associated Image class is a good solution, or it's better to just allow img elements in Link::setNode?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    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.