opensourcer has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
I was parsing a website and found custom attributes for div and span. Is there any way to get those using Web::parser or any modules.
example: <div cid="some data" url="some url">....</div>
Thanks for the help.
Arun

Replies are listed 'Best First'.
Re: parsing custom attributes in span/div tags
by daxim (Curate) on Nov 04, 2013 at 09:10 UTC
    use Web::Query 'wq'; wq('<html><div cid="some data" url="some url">....</div>') ->find('*[cid]') ->text # '....'
Re: parsing custom attributes in span/div tags
by opensourcer (Monk) on Nov 04, 2013 at 09:13 UTC
    Found the solution (http://search.cpan.org/~miyagawa/Web-Scraper-0.37/lib/Web/Scraper.pm#EXAMPLES)
    by using @attr <replace with real attribute name>